if __name__ == '__main__':
n = int(input())
student_marks = []
for _ in range(n):
name, *line = input().split()
scores = list(map(float, line))
student_marks.append({name : sum(scores)/len(scores)})
query_name = input()
for student in student_marks:
for key, value in student.items():
if key == query_name:
print("{:.2f}".format(value))