n = int(input())
x = list(map(int, input().split()))
sum= 1000000000000000
for p in range(1,101):

    tmp=0
    # print("p",p)
    for i in range(len(x)):
        tmp += (x[i] - p)**2
        # print("tmp",tmp)
    sum = min(sum,tmp)
    # print("su",sum)
print(sum) 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 sum= 1000000000000000 sum 1000000000000000 for p in range(1,101):

    tmp=0
    # print("p",p)
    for i in range(len(x)):
        tmp += (x[i] - p)**2
        # print("tmp",tmp)
    sum = min(sum,tmp)
    # print("su",sum) p range(1,101) range 1 101 tmp=0 tmp 0 for i in range(len(x)):
        tmp += (x[i] - p)**2
        # print("tmp",tmp)
     i range(len(x)) range len(x) len x tmp += (x[i] - p)**2 tmp (x[i] - p)**2 x[i] - p x[i] x i p 2 sum = min(sum,tmp) sum min(sum,tmp) min sum tmp print(sum) print sum x = list(map(int, input().split())) list(map(int, input().split())) x sum = min(sum,tmp) min(sum,tmp) sum n = int(input()) int(input()) n tmp=0 0 tmp sum= 1000000000000000 1000000000000000 sum tmp += (x[i] - p)**2 (x[i] - p)**2 tmp
n = int(input())
x = list(map(int, input().split()))
sum= 1000000000000000
for p in range(1,101):

    tmp=0
    # print("p",p)
    for i in range(len(x)):
        tmp += (x[i] - p)**2
        # print("tmp",tmp)
    sum = min(sum,tmp)
    # print("su",sum)
print(sum)