import math n = int(input()) x = list(map(int, input().split())) m = int(input()) # Check if all elements are equal first = x[0] all_equal = True for xi in x: if xi != first: all_equal = False break if all_equal: print(50) else: # Compute average avg = sum(x) / n # Compute sum of squared differences sum_sq = 0.0 for xi in x: diff = xi - avg sum_sq += diff * diff variance = sum_sq / n std_dev = math.sqrt(variance) # Get x_m x_m = x[m-1] diff_x = x_m - avg # Compute t t = (10 * diff_x) / std_dev if diff_x > 0: deviation = 50 + t else: deviation = 50 - t # Floor the deviation and print as integer result = math.floor(deviation) print(int(result))