
def main():
    n = int(input())
    x = list(map(int, input().split(" ")))
    min = 1e9
    for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
    print(min)
        



if __name__ == "__main__":
    main() def main():
    n = int(input())
    x = list(map(int, input().split(" ")))
    min = 1e9
    for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
    print(min)
         main n = int(input()) n int(input()) int 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 " " min = 1e9 min 1e9 for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
     i range(1,101) range 1 101 na = 0 na 0 for j in x:
            na += (j - i)**2
         j x na += (j - i)**2 na (j - i)**2 j - i j i 2 if na < min:
            min = na
     na < min na min min = na min na print(min) print min if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    n = int(input())
    x = list(map(int, input().split(" ")))
    min = 1e9
    for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
    print(min)
         def main():
    n = int(input())
    x = list(map(int, input().split(" ")))
    min = 1e9
    for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
    print(min)
         main

def main():
    n = int(input())
    x = list(map(int, input().split(" ")))
    min = 1e9
    for i in range(1,101):
        na = 0
        for j in x:
            na += (j - i)**2
        if na < min:
            min = na
    print(min)
        



if __name__ == "__main__":
    main()