# coding: utf-8

def main():
    N = input()
    X = list(map(int, input().split()))
    ans = 1000001

    for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

    print(ans)

if __name__ == "__main__":
    main() def main():
    N = input()
    X = list(map(int, input().split()))
    ans = 1000001

    for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

    print(ans) main N = input() N 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 ans = 1000001 ans 1000001 for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

     i range(1, 101) range 1 101 (x - i) ** 2 for x in X for x in X x X for x in X (x - i) ** 2 x - i x i 2 tmp = sum([(x - i) ** 2 for x in X]) tmp sum([(x - i) ** 2 for x in X]) sum [(x - i) ** 2 for x in X] if tmp < ans:
            ans = tmp

     tmp < ans tmp ans ans = tmp ans tmp print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N = input()
    X = list(map(int, input().split()))
    ans = 1000001

    for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

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

    for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

    print(ans) main
# coding: utf-8

def main():
    N = input()
    X = list(map(int, input().split()))
    ans = 1000001

    for i in range(1, 101):
        tmp = sum([(x - i) ** 2 for x in X])
        if tmp < ans:
            ans = tmp

    print(ans)

if __name__ == "__main__":
    main()
