import math

n = int(input())
address = list(map(int, input().split()))

min_hp = math.inf

for i in range(1, 101):
	hp = sum(map(lambda x: (x - i) ** 2, address))
	if hp < min_hp:
		min_hp = hp
		
print(min_hp) import math math n = int(input()) n int(input()) int input() input address = list(map(int, input().split())) address list(map(int, input().split())) list map(int, input().split()) map int input().split() ().split () input split min_hp = math.inf min_hp math.inf math inf for i in range(1, 101):
	hp = sum(map(lambda x: (x - i) ** 2, address))
	if hp < min_hp:
		min_hp = hp
		 i range(1, 101) range 1 101 hp = sum(map(lambda x: (x - i) ** 2, address)) hp sum(map(lambda x: (x - i) ** 2, address)) sum map(lambda x: (x - i) ** 2, address) map lambda x: (x - i) ** 2 (x - i) ** 2 x - i x i 2 x address if hp < min_hp:
		min_hp = hp
		 hp < min_hp hp min_hp min_hp = hp min_hp hp print(min_hp) print min_hp address = list(map(int, input().split())) list(map(int, input().split())) address min_hp = math.inf math.inf min_hp hp = sum(map(lambda x: (x - i) ** 2, address)) sum(map(lambda x: (x - i) ** 2, address)) hp min_hp = hp hp min_hp n = int(input()) int(input()) n
import math

n = int(input())
address = list(map(int, input().split()))

min_hp = math.inf

for i in range(1, 101):
	hp = sum(map(lambda x: (x - i) ** 2, address))
	if hp < min_hp:
		min_hp = hp
		
print(min_hp)