import math

N = input()
XS = [int(i) for i in input().split()]

m = 9999999999
for i in range(1, 101):
	c = sum([(x - i) ** 2 for x in XS])
	if m > c:
		m = c

print(m) import math math N = input() N input() input int(i) for i in input().split() for i in input().split() i input().split() ().split () input split for i in input().split() int(i) int i XS = [int(i) for i in input().split()] XS [int(i) for i in input().split()] m = 9999999999 m 9999999999 for i in range(1, 101):
	c = sum([(x - i) ** 2 for x in XS])
	if m > c:
		m = c i range(1, 101) range 1 101 (x - i) ** 2 for x in XS for x in XS x XS for x in XS (x - i) ** 2 x - i x i 2 c = sum([(x - i) ** 2 for x in XS]) c sum([(x - i) ** 2 for x in XS]) sum [(x - i) ** 2 for x in XS] if m > c:
		m = c m > c m c m = c m c print(m) print m N = input() input() N XS = [int(i) for i in input().split()] [int(i) for i in input().split()] XS m = c c m c = sum([(x - i) ** 2 for x in XS]) sum([(x - i) ** 2 for x in XS]) c m = 9999999999 9999999999 m
import math

N = input()
XS = [int(i) for i in input().split()]

m = 9999999999
for i in range(1, 101):
	c = sum([(x - i) ** 2 for x in XS])
	if m > c:
		m = c

print(m)
