n = int(input())
student_marks = {}
for _ in range(n):
        name, *mark = input().split()
        scores = list(map(float, mark))
        student_marks[name] = scores
query_name = input()

output = list(student_marks[query_name])    
per = sum(output)/len(output)

print("%.2f" % per);