# import itertools
# import math
# import sys
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
# Q = list(map(int, input().split()))
# S = input()

# d = sorted(d.items(), key=lambda x:x[0]) # keyでsort

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

tots = []
for i in range(1, 101):
    tot = 0
    for j in X:
        tot += (j - i) ** 2
    tots.append(tot)

print(min(tots)) 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 tots = [] tots [] for i in range(1, 101):
    tot = 0
    for j in X:
        tot += (j - i) ** 2
    tots.append(tot) i range(1, 101) range 1 101 tot = 0 tot 0 for j in X:
        tot += (j - i) ** 2
     j X tot += (j - i) ** 2 tot (j - i) ** 2 j - i j i 2 tots.append(tot) tots.append tots append tot print(min(tots)) print min(tots) min tots tot = 0 0 tot N = int(input()) int(input()) N tots = [] [] tots tot += (j - i) ** 2 (j - i) ** 2 tot X = list(map(int, input().split())) list(map(int, input().split())) X
# import itertools
# import math
# import sys
# import numpy as np

N = int(input())
# S = input()
# n, *a = map(int, open(0))
# N, K = map(int, input().split())
# A = list(map(int, input().split()))
# Q = list(map(int, input().split()))
# S = input()

# d = sorted(d.items(), key=lambda x:x[0]) # keyでsort

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

tots = []
for i in range(1, 101):
    tot = 0
    for j in X:
        tot += (j - i) ** 2
    tots.append(tot)

print(min(tots))