program main
 implicit none
 integer N
 integer,allocatable :: X(:)
 integer i,j
 integer :: sumr=0, minr=-1
 
 read *,N
 allocate(X(N))
 read *,X
 
 do i=1,100
  sumr=0
  do j=1,N
  sumr=sumr+(i-X(j))*(i-X(j))
  end do
  if ( sumr < minr .or. minr == -1) minr=sumr
 end do
 
 print '(i0)', minr
 
 endprogram main