  Program Main

    Implicit None

    Integer, Allocatable :: X(:),P(:)
    Integer(8)           :: i,j,N,dum

    N = 0
    Read(*,*) N
    Allocate (P(100)); P(:) = 100000
    Allocate (X(N)); X(:) = 0
    Read(*,*)(X(i),i=1,N)

    Do i = 1,100
       dum = 0
       Do j = 1,N
          dum = dum + (X(j) - i)**2
       Enddo
       P(i) = dum 
    Enddo

    Do i = 1,99
       Do j = i+1,100
          If (P(i) < P(j)) then
             dum  = P(i)
             P(i) = P(j)
             P(j) = dum
          Endif
       Enddo
    Enddo

    Write(*,"(I0)") P(100)

  End Program
