import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    X = list(map(int, readline().split()))
    ans = INF

    for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

    print(ans)


if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    N = int(readline())
    X = list(map(int, readline().split()))
    ans = INF

    for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

    print(ans) main N = int(readline()) N int(readline()) int readline() readline X = list(map(int, readline().split())) X list(map(int, readline().split())) list map(int, readline().split()) map int readline().split() ().split () readline split ans = INF ans INF for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

     i range(1, 101) range 1 101 score = 0 score 0 for x in X:
            score += (x - i) ** 2
         x X score += (x - i) ** 2 score (x - i) ** 2 x - i x i 2 ans = min(ans, score) ans min(ans, score) min ans score print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD def main():
    N = int(readline())
    X = list(map(int, readline().split()))
    ans = INF

    for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

    print(ans) def main():
    N = int(readline())
    X = list(map(int, readline().split()))
    ans = INF

    for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

    print(ans) main readline = sys.stdin.readline sys.stdin.readline readline INF = float('INF') float('INF') INF
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    N = int(readline())
    X = list(map(int, readline().split()))
    ans = INF

    for i in range(1, 101):
        score = 0
        for x in X:
            score += (x - i) ** 2
        ans = min(ans, score)

    print(ans)


if __name__ == '__main__':
    main()
