N=int(input())
X=list(map(int,input().split()))


pdlist=[]

for i in range(101):
    pd=0
    for j in X:
        pd+=(i-j)**2
    pdlist.append(pd)
    
pdlist.sort()
print(pdlist[0]) 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 pdlist=[] pdlist [] for i in range(101):
    pd=0
    for j in X:
        pd+=(i-j)**2
    pdlist.append(pd)
     i range(101) range 101 pd=0 pd 0 for j in X:
        pd+=(i-j)**2
     j X pd+=(i-j)**2 pd (i-j)**2 i-j i j 2 pdlist.append(pd) pdlist.append pdlist append pd pdlist.sort() pdlist.sort pdlist sort print(pdlist[0]) print pdlist[0] pdlist 0 X=list(map(int,input().split())) list(map(int,input().split())) X pd+=(i-j)**2 (i-j)**2 pd N=int(input()) int(input()) N pd=0 0 pd pdlist=[] [] pdlist
N=int(input())
X=list(map(int,input().split()))


pdlist=[]

for i in range(101):
    pd=0
    for j in X:
        pd+=(i-j)**2
    pdlist.append(pd)
    
pdlist.sort()
print(pdlist[0])
