import numpy as np

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N = int(readline())

    X = [int(i) for i in readline().split()]

    X = np.array(X)



    ans = np.min(np.sum((X - np.arange(1,101).reshape(100, 1))**2, axis=1))

    print(ans)





if __name__ == "__main__":

    main()

import sys

read = sys.stdin.read

readline = sys.stdin.readline

readlines = sys.stdin.readlines



def main():

    N = int(readline())

    X = [int(i) for i in readline().split()]



    ans = float('inf')

    for i in range(1,101):

        tmp = 0

        for x in X:

            tmp += (x - i)**2

        

        if tmp < ans:

            ans = tmp



    print(ans)





if __name__ == "__main__":

    main()

import numpy as np
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N = int(readline())
    X = [int(i) for i in readline().split()]
    X = np.array(X)
    ans = np.min(np.sum((X - np.arange(1, 101).reshape(100, 1)) ** 2, axis=1))
    print(ans)


if __name__ == "__main__":
    main()

import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    N = int(readline())
    X = [int(i) for i in readline().split()]
    ans = float("inf")
    for i in range(1, 101):
        tmp = 0
        for x in X:
            tmp += (x - i) ** 2
        if tmp < ans:
            ans = tmp
    print(ans)


if __name__ == "__main__":
    main()

-import numpy as np -    X = np.array(X) -    ans = np.min(np.sum((X - np.arange(1, 101).reshape(100, 1)) ** 2, axis=1)) +    ans = float("inf") +    for i in range(1, 101): +        tmp = 0 +        for x in X: +            tmp += (x - i) ** 2 +        if tmp < ans: +            ans = tmp