n=int(input())
x=list(map(int,input().split()))
ans=[]

for i in range(1,101):
    y=0

    for j in range(n):
        y+=(x[j]-i)**2
    ans.append(y)
print(min(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=[] ans [] for i in range(1,101):
    y=0

    for j in range(n):
        y+=(x[j]-i)**2
    ans.append(y) i range(1,101) range 1 101 y=0 y 0 for j in range(n):
        y+=(x[j]-i)**2
     j range(n) range n y+=(x[j]-i)**2 y (x[j]-i)**2 x[j]-i x[j] x j i 2 ans.append(y) ans.append ans append y print(min(ans)) print min(ans) min ans ans=[] [] ans y=0 0 y y+=(x[j]-i)**2 (x[j]-i)**2 y n=int(input()) int(input()) n x=list(map(int,input().split())) list(map(int,input().split())) x
n=int(input())
x=list(map(int,input().split()))
ans=[]

for i in range(1,101):
    y=0

    for j in range(n):
        y+=(x[j]-i)**2
    ans.append(y)
print(min(ans))
        
