import math

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

#  O(100N)とかになりそうだし全探索で良さげ

xmin = 10 ** 7

for i in range(1, 101):
    xsum = 0
    for j in range(N):
        xsum += (X[j] - i) ** 2
    xmin = min(xmin, xsum)

print(xmin) import math math 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 xmin = 10 ** 7 xmin 10 ** 7 10 7 for i in range(1, 101):
    xsum = 0
    for j in range(N):
        xsum += (X[j] - i) ** 2
    xmin = min(xmin, xsum) i range(1, 101) range 1 101 xsum = 0 xsum 0 for j in range(N):
        xsum += (X[j] - i) ** 2
     j range(N) range N xsum += (X[j] - i) ** 2 xsum (X[j] - i) ** 2 X[j] - i X[j] X j i 2 xmin = min(xmin, xsum) xmin min(xmin, xsum) min xmin xsum print(xmin) print xmin xmin = 10 ** 7 10 ** 7 xmin X = list(map(int, input().split())) list(map(int, input().split())) X xmin = min(xmin, xsum) min(xmin, xsum) xmin xsum = 0 0 xsum N = int(input()) int(input()) N xsum += (X[j] - i) ** 2 (X[j] - i) ** 2 xsum
import math

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

#  O(100N)とかになりそうだし全探索で良さげ

xmin = 10 ** 7

for i in range(1, 101):
    xsum = 0
    for j in range(N):
        xsum += (X[j] - i) ** 2
    xmin = min(xmin, xsum)

print(xmin)