import math
N = int(input())
x = list(map(int,input().split()))

minimum = math.inf
for i in range(101):
    stamina = 0
    for j in range(N):
        stamina += (x[j]-i)**2
    minimum = min(minimum,stamina)

print(minimum) import math math 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 minimum = math.inf minimum math.inf math inf for i in range(101):
    stamina = 0
    for j in range(N):
        stamina += (x[j]-i)**2
    minimum = min(minimum,stamina) i range(101) range 101 stamina = 0 stamina 0 for j in range(N):
        stamina += (x[j]-i)**2
     j range(N) range N stamina += (x[j]-i)**2 stamina (x[j]-i)**2 x[j]-i x[j] x j i 2 minimum = min(minimum,stamina) minimum min(minimum,stamina) min minimum stamina print(minimum) print minimum stamina += (x[j]-i)**2 (x[j]-i)**2 stamina x = list(map(int,input().split())) list(map(int,input().split())) x minimum = math.inf math.inf minimum N = int(input()) int(input()) N minimum = min(minimum,stamina) min(minimum,stamina) minimum stamina = 0 0 stamina
import math
N = int(input())
x = list(map(int,input().split()))

minimum = math.inf
for i in range(101):
    stamina = 0
    for j in range(N):
        stamina += (x[j]-i)**2
    minimum = min(minimum,stamina)

print(minimum)