#!/usr/bin/env python3

n = int(eval(input()))

x = list(map(int,input().split()))

ans = 10**6 #INF

for i in range(1,101):

    ans = min(ans,sum([(k-i)**2 for k in x]))

    #print(ans,sum([(k-i)**2 for k in x]))

print(ans)
#!/usr/bin/env python3

n = int(eval(input()))

x = list(map(int,input().split()))

ans = 10**6

for i in range(1,101):

  k = 0

  for j in range(n):

    k += (x[j]-i) **2

  ans = min(ans,k)

print(ans)
#!/usr/bin/env python3
n = int(eval(input()))
x = list(map(int, input().split()))
ans = 10**6  # INF
for i in range(1, 101):
    ans = min(ans, sum([(k - i) ** 2 for k in x]))
    # print(ans,sum([(k-i)**2 for k in x]))
print(ans)

#!/usr/bin/env python3
n = int(eval(input()))
x = list(map(int, input().split()))
ans = 10**6
for i in range(1, 101):
    k = 0
    for j in range(n):
        k += (x[j] - i) ** 2
    ans = min(ans, k)
print(ans)

-ans = 10**6  # INF +ans = 10**6 -    ans = min(ans, sum([(k - i) ** 2 for k in x])) -    # print(ans,sum([(k-i)**2 for k in x])) +    k = 0 +    for j in range(n): +        k += (x[j] - i) ** 2 +    ans = min(ans, k)