import numpy as np
n=int(input())
x1=list(map(int,input().split()))
ans=1000000000000000000000
for i in np.arange(1,101):
    hp=0
    for j in x1:
        hp+=(j-i)*(j-i)
    if hp<=ans:
        ans=hp
print(ans) import numpy as np numpy n=int(input()) n int(input()) int input() input x1=list(map(int,input().split())) x1 list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans=1000000000000000000000 ans 1000000000000000000000 for i in np.arange(1,101):
    hp=0
    for j in x1:
        hp+=(j-i)*(j-i)
    if hp<=ans:
        ans=hp i np.arange(1,101) np.arange np arange 1 101 hp=0 hp 0 for j in x1:
        hp+=(j-i)*(j-i)
     j x1 hp+=(j-i)*(j-i) hp (j-i)*(j-i) j-i j i j-i j i if hp<=ans:
        ans=hp hp<=ans hp ans ans=hp ans hp print(ans) print ans hp+=(j-i)*(j-i) (j-i)*(j-i) hp ans=hp hp ans ans=1000000000000000000000 1000000000000000000000 ans x1=list(map(int,input().split())) list(map(int,input().split())) x1 n=int(input()) int(input()) n hp=0 0 hp
import numpy as np
n=int(input())
x1=list(map(int,input().split()))
ans=1000000000000000000000
for i in np.arange(1,101):
    hp=0
    for j in x1:
        hp+=(j-i)*(j-i)
    if hp<=ans:
        ans=hp
print(ans)