N = int(input())
ans = 10**8
array = list(map(int,input().split()))
for i in range(0,101):
  energy = 0
  for t in array:
    energy += ( t - i ) ** 2
  ans = min(ans,energy)
print(ans)
     N = int(input()) N int(input()) int input() input ans = 10**8 ans 10**8 10 8 array = list(map(int,input().split())) array list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split for i in range(0,101):
  energy = 0
  for t in array:
    energy += ( t - i ) ** 2
  ans = min(ans,energy) i range(0,101) range 0 101 energy = 0 energy 0 for t in array:
    energy += ( t - i ) ** 2
   t array energy += ( t - i ) ** 2 energy ( t - i ) ** 2 t - i t i 2 ans = min(ans,energy) ans min(ans,energy) min ans energy print(ans) print ans energy += ( t - i ) ** 2 ( t - i ) ** 2 energy N = int(input()) int(input()) N ans = 10**8 10**8 ans ans = min(ans,energy) min(ans,energy) ans array = list(map(int,input().split())) list(map(int,input().split())) array energy = 0 0 energy
N = int(input())
ans = 10**8
array = list(map(int,input().split()))
for i in range(0,101):
  energy = 0
  for t in array:
    energy += ( t - i ) ** 2
  ans = min(ans,energy)
print(ans)
    
