import numpy as np
N = int(input())
N_List = list(map(int,input().split()))
ans = (100**2)*100
for i in range(1,101):
    ca = sum(map(lambda x:(x-i)**2,N_List))
    if ca < ans:
        ans = ca

print(ans) import numpy as np numpy N = int(input()) N int(input()) int input() input N_List = list(map(int,input().split())) N_List list(map(int,input().split())) list map(int,input().split()) map int input().split() ().split () input split ans = (100**2)*100 ans (100**2)*100 100**2 100 2 100 for i in range(1,101):
    ca = sum(map(lambda x:(x-i)**2,N_List))
    if ca < ans:
        ans = ca i range(1,101) range 1 101 ca = sum(map(lambda x:(x-i)**2,N_List)) ca sum(map(lambda x:(x-i)**2,N_List)) sum map(lambda x:(x-i)**2,N_List) map lambda x:(x-i)**2 (x-i)**2 x-i x i 2 x N_List if ca < ans:
        ans = ca ca < ans ca ans ans = ca ans ca print(ans) print ans ans = ca ca ans N = int(input()) int(input()) N ca = sum(map(lambda x:(x-i)**2,N_List)) sum(map(lambda x:(x-i)**2,N_List)) ca N_List = list(map(int,input().split())) list(map(int,input().split())) N_List ans = (100**2)*100 (100**2)*100 ans
import numpy as np
N = int(input())
N_List = list(map(int,input().split()))
ans = (100**2)*100
for i in range(1,101):
    ca = sum(map(lambda x:(x-i)**2,N_List))
    if ca < ans:
        ans = ca

print(ans)
