N=int(input())
List = list(map(int, input().split()))
res = 1000000000000
mid = 0
for i in range(101):
  for j in range(N):
    mid += (i-List[j])**2
  res = min(res,mid)
  mid = 0
print(res) N=int(input()) N int(input()) int input() input List = list(map(int, input().split())) List list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split res = 1000000000000 res 1000000000000 mid = 0 mid 0 for i in range(101):
  for j in range(N):
    mid += (i-List[j])**2
  res = min(res,mid)
  mid = 0 i range(101) range 101 for j in range(N):
    mid += (i-List[j])**2
   j range(N) range N mid += (i-List[j])**2 mid (i-List[j])**2 i-List[j] i List[j] List j 2 res = min(res,mid) res min(res,mid) min res mid mid = 0 mid 0 print(res) print res mid += (i-List[j])**2 (i-List[j])**2 mid mid = 0 0 mid mid = 0 0 mid res = 1000000000000 1000000000000 res N=int(input()) int(input()) N res = min(res,mid) min(res,mid) res List = list(map(int, input().split())) list(map(int, input().split())) List
N=int(input())
List = list(map(int, input().split()))
res = 1000000000000
mid = 0
for i in range(101):
  for j in range(N):
    mid += (i-List[j])**2
  res = min(res,mid)
  mid = 0
print(res)