N = int(input())

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

ans = 10000000000000000

for i in range(101):
    tmp = 0
    for x in X:
        tmp += (i-x)**2
    ans = min(ans, tmp)
print(ans) 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 ans = 10000000000000000 ans 10000000000000000 for i in range(101):
    tmp = 0
    for x in X:
        tmp += (i-x)**2
    ans = min(ans, tmp) i range(101) range 101 tmp = 0 tmp 0 for x in X:
        tmp += (i-x)**2
     x X tmp += (i-x)**2 tmp (i-x)**2 i-x i x 2 ans = min(ans, tmp) ans min(ans, tmp) min ans tmp print(ans) print ans X = list(map(int,input().split())) list(map(int,input().split())) X ans = min(ans, tmp) min(ans, tmp) ans ans = 10000000000000000 10000000000000000 ans tmp = 0 0 tmp N = int(input()) int(input()) N tmp += (i-x)**2 (i-x)**2 tmp
N = int(input())

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

ans = 10000000000000000

for i in range(101):
    tmp = 0
    for x in X:
        tmp += (i-x)**2
    ans = min(ans, tmp)
print(ans)