N=int(input())
X=[int(i) for i in input().split()]

X.sort()

if N%2==0:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a)
else:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a)

print(ans) N=int(input()) N int(input()) int input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i X=[int(i) for i in input().split()] X [int(i) for i in input().split()] X.sort() X.sort X sort if N%2==0:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a)
else:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a) N%2==0 N%2 N 2 0 ans=10**10 ans 10**10 10 10 for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a) i range(1,100) range 1 100 a=0 a 0 for j in range(N):
            a+=(X[j]-i)**2
         j range(N) range N a+=(X[j]-i)**2 a (X[j]-i)**2 X[j]-i X[j] X j i 2 ans=min(ans,a) ans min(ans,a) min ans a ans=10**10 ans 10**10 10 10 for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a) i range(1,100) range 1 100 a=0 a 0 for j in range(N):
            a+=(X[j]-i)**2
         j range(N) range N a+=(X[j]-i)**2 a (X[j]-i)**2 X[j]-i X[j] X j i 2 ans=min(ans,a) ans min(ans,a) min ans a print(ans) print ans N=int(input()) int(input()) N a+=(X[j]-i)**2 (X[j]-i)**2 a a=0 0 a a+=(X[j]-i)**2 (X[j]-i)**2 a ans=10**10 10**10 ans ans=min(ans,a) min(ans,a) ans X=[int(i) for i in input().split()] [int(i) for i in input().split()] X ans=10**10 10**10 ans a=0 0 a ans=min(ans,a) min(ans,a) ans
N=int(input())
X=[int(i) for i in input().split()]

X.sort()

if N%2==0:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a)
else:
    ans=10**10
    for i in range(1,100):
        a=0
        for j in range(N):
            a+=(X[j]-i)**2
        ans=min(ans,a)

print(ans)
