program rally
implicit none
integer n
integer, allocatable :: listx(:)
integer i, j
integer power, powerold
!
! input
read *, n
allocate(listx(n))
read *, listx
!
! calculation
powerold=1000000
do i = 1, 100
  power = 0
  do j = 1, n
    power = power + (listx(j) - i)**2
  end do
  if(power<powerold) then
    powerold = power
  end if
end do
!
! output
print '(i0)', powerold
end program