# C - Rally
N = int(input())
X = list(map(int,input().split()))
ans = 10**10
for p in range(1,101):
    tmp = 0
    for x in X:
        tmp += (x-p)**2
    ans = min(ans,tmp)
print(ans) N = int(input()) N int(input()) int input() input X = list(map(int,input().split())) X list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = 10**10 ans 10**10 10 10 for p in range(1,101):
    tmp = 0
    for x in X:
        tmp += (x-p)**2
    ans = min(ans,tmp) p range(1,101) range 1 101 tmp = 0 tmp 0 for x in X:
        tmp += (x-p)**2
     x X tmp += (x-p)**2 tmp (x-p)**2 x-p x p 2 ans = min(ans,tmp) ans min(ans,tmp) min ans tmp print(ans) print ans tmp = 0 0 tmp ans = min(ans,tmp) min(ans,tmp) ans N = int(input()) int(input()) N ans = 10**10 10**10 ans X = list(map(int,input().split())) list(map(int,input().split())) X tmp += (x-p)**2 (x-p)**2 tmp
# C - Rally
N = int(input())
X = list(map(int,input().split()))
ans = 10**10
for p in range(1,101):
    tmp = 0
    for x in X:
        tmp += (x-p)**2
    ans = min(ans,tmp)
print(ans)