import math n = int(input()) A = list(map(int, input().split())) m = int(input()) ave = sum(A) / n q1 = [((a - ave) ** 2) for a in A] q2 = math.sqrt(sum(q1) / n) q3 = abs(A[m - 1] - ave) * 10 / q2 if q2 == 0: print(50) elif A[m - 1] > ave: print(int(50 + q3)) else: print(int(50 - q3))