n = int(input()) students = list(map(int, input().split())) m = int(input()) ave = sum(students) / n std = (sum((student - ave) ** 2 for student in students) / n) ** 0.5 for i in range(m): if i == m - 1: print(int(((students[i] - ave) / std) * 10 + 50)) break