n = int(input())
l = list(map(int, input().split()))
ans = 1000000
for p in range(1,101):
  d = 0
  for x in l:
    d += (x-p)**2
  ans = min(d,ans)
print(ans) n = int(input()) n int(input()) int input() input l = list(map(int, input().split())) l list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split ans = 1000000 ans 1000000 for p in range(1,101):
  d = 0
  for x in l:
    d += (x-p)**2
  ans = min(d,ans) p range(1,101) range 1 101 d = 0 d 0 for x in l:
    d += (x-p)**2
   x l d += (x-p)**2 d (x-p)**2 x-p x p 2 ans = min(d,ans) ans min(d,ans) min d ans print(ans) print ans ans = 1000000 1000000 ans d = 0 0 d d += (x-p)**2 (x-p)**2 d l = list(map(int, input().split())) list(map(int, input().split())) l ans = min(d,ans) min(d,ans) ans n = int(input()) int(input()) n
n = int(input())
l = list(map(int, input().split()))
ans = 1000000
for p in range(1,101):
  d = 0
  for x in l:
    d += (x-p)**2
  ans = min(d,ans)
print(ans)