import math
n = int(input())
xn_list = list(map(int, input().split()))
ans = float('inf')
for i in range(1, 100):
    temp = 0
    for j in xn_list:
        temp += (j-i)**2
    ans = min(ans, temp)
print(ans) import math math n = int(input()) n int(input()) int input() input xn_list = list(map(int, input().split())) xn_list list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = float('inf') ans float('inf') float 'inf' for i in range(1, 100):
    temp = 0
    for j in xn_list:
        temp += (j-i)**2
    ans = min(ans, temp) i range(1, 100) range 1 100 temp = 0 temp 0 for j in xn_list:
        temp += (j-i)**2
     j xn_list temp += (j-i)**2 temp (j-i)**2 j-i j i 2 ans = min(ans, temp) ans min(ans, temp) min ans temp print(ans) print ans temp += (j-i)**2 (j-i)**2 temp temp = 0 0 temp ans = min(ans, temp) min(ans, temp) ans xn_list = list(map(int, input().split())) list(map(int, input().split())) xn_list n = int(input()) int(input()) n ans = float('inf') float('inf') ans
import math
n = int(input())
xn_list = list(map(int, input().split()))
ans = float('inf')
for i in range(1, 100):
    temp = 0
    for j in xn_list:
        temp += (j-i)**2
    ans = min(ans, temp)
print(ans)