program main
    implicit none
    integer(4):: n, hp(100),i
    integer(4),allocatable:: x(:)

    read*, n
    allocate(x(n))
    read*, x(:)

    do i = 1, 100
        hp(i) = sum((x(:)-i)*(x(:)-i))
    end do

    print*, minval(hp(:))


end program