#!/usr/bin/env python3
def main():
    _ = int(input())
    X = [int(x) for x in input().split()]

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


if __name__ == '__main__':
    main() def main():
    _ = int(input())
    X = [int(x) for x in input().split()]

    ans = 10 ** 6
    for i in range(1, 101):
        res = 0
        for x in X:
            res += (x - i) ** 2
        ans = min(ans, res)
    print(ans) main _ = int(input()) _ int(input()) int input() input int(x) for x in input().split() for x in input().split() x input().split() ().split () input split for x in input().split() int(x) int x X = [int(x) for x in input().split()] X [int(x) for x in input().split()] ans = 10 ** 6 ans 10 ** 6 10 6 for i in range(1, 101):
        res = 0
        for x in X:
            res += (x - i) ** 2
        ans = min(ans, res)
     i range(1, 101) range 1 101 res = 0 res 0 for x in X:
            res += (x - i) ** 2
         x X res += (x - i) ** 2 res (x - i) ** 2 x - i x i 2 ans = min(ans, res) ans min(ans, res) min ans res print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    _ = int(input())
    X = [int(x) for x in input().split()]

    ans = 10 ** 6
    for i in range(1, 101):
        res = 0
        for x in X:
            res += (x - i) ** 2
        ans = min(ans, res)
    print(ans) def main():
    _ = int(input())
    X = [int(x) for x in input().split()]

    ans = 10 ** 6
    for i in range(1, 101):
        res = 0
        for x in X:
            res += (x - i) ** 2
        ans = min(ans, res)
    print(ans) main
#!/usr/bin/env python3
def main():
    _ = int(input())
    X = [int(x) for x in input().split()]

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


if __name__ == '__main__':
    main()
