N = int(input()) X = list(map(int, input().split())) A = [] M = 0 for i in range(N): A.append(X[i]) M += A[i] M /= N AS = True for i in range(1, N): if A[i] != A[0]: AS = False break if AS: print("50") exit(0) Q = 0 for i in range(N): Q += (A[i] - M) ** 2 RQ = (Q / N) ** 0.5 M1 = int(input()) ret = 50 + 10 * (A[M1 - 1] - M) / RQ if 50 + 10 * (A[M1 - 1] - M) / RQ >= 0: print(int(50 + 10 * (A[M1 - 1] - M) / RQ)) else: print(int(50 + 10 * (A[M1 - 1] - M) / RQ))