#template
def inputlist(): return [int(j) for j in input().split()]
def listinput(): return input().split()
#template
N = int(input())
X = inputlist()
ans = 10**9+7
for i in range(101):
    tmp = 0
    for j in range(N):
        tmp += (X[j]- i)**2
    ans = min(ans,tmp)
print(ans) int(j) for j in input().split() for j in input().split() j input().split() ().split () input split for j in input().split() int(j) int j def inputlist(): return [int(j) for j in input().split()] inputlist def listinput(): return input().split()
#template listinput N = int(input()) N int(input()) int input() input X = inputlist() X inputlist() inputlist ans = 10**9+7 ans 10**9+7 10**9 10 9 7 for i in range(101):
    tmp = 0
    for j in range(N):
        tmp += (X[j]- i)**2
    ans = min(ans,tmp) i range(101) range 101 tmp = 0 tmp 0 for j in range(N):
        tmp += (X[j]- i)**2
     j range(N) range N tmp += (X[j]- i)**2 tmp (X[j]- i)**2 X[j]- i X[j] X j i 2 ans = min(ans,tmp) ans min(ans,tmp) min ans tmp print(ans) print ans X = inputlist() inputlist() X def inputlist(): return [int(j) for j in input().split()] def inputlist(): return [int(j) for j in input().split()] inputlist ans = 10**9+7 10**9+7 ans def listinput(): return input().split()
#template def listinput(): return input().split()
#template listinput tmp = 0 0 tmp N = int(input()) int(input()) N tmp += (X[j]- i)**2 (X[j]- i)**2 tmp ans = min(ans,tmp) min(ans,tmp) ans
#template
def inputlist(): return [int(j) for j in input().split()]
def listinput(): return input().split()
#template
N = int(input())
X = inputlist()
ans = 10**9+7
for i in range(101):
    tmp = 0
    for j in range(N):
        tmp += (X[j]- i)**2
    ans = min(ans,tmp)
print(ans)