'''
Title     : Finding the percentage
Subdomain : Basic Data Types
Domain    : Python
Author    : codeperfectplus
Created   : 17 January 2020
'''
if __name__ == '__main__':
    n = int(input())
    student_marks = {}
    for _ in range(n):
        name, *line = input().split()
        scores = list(map(float, line))
        student_marks[name] = scores
    query_name = input()
    query_scores = student_marks[query_name]
    print("{0:.2f}".format(sum(query_scores)/(len(query_scores))))