def mapt(fn, *args):
    return tuple(map(fn, *args))

def main():
    n = int(input())
    x = mapt(int, input().split(" "))
    ans = float("inf")
    for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
    print(ans)

main() def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt return tuple(map(fn, *args)) tuple(map(fn, *args)) tuple map(fn, *args) map fn *args args fn fn *args def main():
    n = int(input())
    x = mapt(int, input().split(" "))
    ans = float("inf")
    for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
    print(ans) main n = int(input()) n int(input()) int input() input x = mapt(int, input().split(" ")) x mapt(int, input().split(" ")) mapt int input().split(" ") ().split () input split " " ans = float("inf") ans float("inf") float "inf" for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
     p range(1, 101) range 1 101 r = 0 r 0 for xj in x:
            r += (xj-(p))**2
         xj x r += (xj-(p))**2 r (xj-(p))**2 xj-(p) xj p 2 ans = min(ans, r) ans min(ans, r) min ans r print(ans) print ans main() main def mapt(fn, *args):
    return tuple(map(fn, *args)) def mapt(fn, *args):
    return tuple(map(fn, *args)) mapt def main():
    n = int(input())
    x = mapt(int, input().split(" "))
    ans = float("inf")
    for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
    print(ans) def main():
    n = int(input())
    x = mapt(int, input().split(" "))
    ans = float("inf")
    for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
    print(ans) main
def mapt(fn, *args):
    return tuple(map(fn, *args))

def main():
    n = int(input())
    x = mapt(int, input().split(" "))
    ans = float("inf")
    for p in range(1, 101):
        r = 0
        for xj in x:
            r += (xj-(p))**2
        ans = min(ans, r)
    print(ans)

main()