import sys

from collections import *

import heapq

import math

import bisect

from itertools import permutations,accumulate,combinations,product

from fractions import gcd

def input():

    return sys.stdin.readline()[:-1]

def ruiseki(lst):

    return [0]+list(accumulate(lst))

mod=pow(10,9)+7



n=int(eval(input()))

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

ans=float('inf')

for i in range(100):

    tmp=0

    for j in range(n):

        tmp+=(x[j]-i-1)**2

    ans=min(ans,tmp)

print(ans)
import bisect, copy, heapq, math, sys

from collections import *

from functools import lru_cache

from itertools import accumulate, combinations, permutations, product

def input():

    return sys.stdin.readline()[:-1]

def ruiseki(lst):

    return [0]+list(accumulate(lst))

def celi(a,b):

    return -(-a//b)

sys.setrecursionlimit(5000000)

mod=pow(10,9)+7

al=[chr(ord('a') + i) for i in range(26)]

direction=[[1,0],[0,1],[-1,0],[0,-1]]



n=int(eval(input()))

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



ans=float('inf')

for i in range(100):

    tmp=0

    for j in range(n):

        tmp+=(x[j]-i-1)**2

    ans=min(ans,tmp)

print(ans)
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations, accumulate, combinations, product
from fractions import gcd


def input():
    return sys.stdin.readline()[:-1]


def ruiseki(lst):
    return [0] + list(accumulate(lst))


mod = pow(10, 9) + 7
n = int(eval(input()))
x = list(map(int, input().split()))
ans = float("inf")
for i in range(100):
    tmp = 0
    for j in range(n):
        tmp += (x[j] - i - 1) ** 2
    ans = min(ans, tmp)
print(ans)

import bisect, copy, heapq, math, sys
from collections import *
from functools import lru_cache
from itertools import accumulate, combinations, permutations, product


def input():
    return sys.stdin.readline()[:-1]


def ruiseki(lst):
    return [0] + list(accumulate(lst))


def celi(a, b):
    return -(-a // b)


sys.setrecursionlimit(5000000)
mod = pow(10, 9) + 7
al = [chr(ord("a") + i) for i in range(26)]
direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]
n = int(eval(input()))
x = list(map(int, input().split()))
ans = float("inf")
for i in range(100):
    tmp = 0
    for j in range(n):
        tmp += (x[j] - i - 1) ** 2
    ans = min(ans, tmp)
print(ans)

-import sys +import bisect, copy, heapq, math, sys -import heapq -import math -import bisect -from itertools import permutations, accumulate, combinations, product -from fractions import gcd +from functools import lru_cache +from itertools import accumulate, combinations, permutations, product +def celi(a, b): +    return -(-a // b) + + +sys.setrecursionlimit(5000000) +al = [chr(ord("a") + i) for i in range(26)] +direction = [[1, 0], [0, 1], [-1, 0], [0, -1]]