      PROGRAM RALLY

      INTEGER N,X(100)
      INTEGER MIN,TOTAL

      MIN=1000000000

      READ(*,*) N

      DO 100 I=1,N
        READ(*,*) X(I)
  100 CONTINUE

      WRITE(*,*)N
      DO 110 I=1,N
        WRITE(*,*)X(i)
  110 CONTINUE

      DO 200 I=1,100
        TOTAL=0

        DO 300 J=1,N
          TOTAL=TOTAL+(X(J)-I)*(X(J)-I)
  300   CONTINUE

        IF(TOTAL.LT.MIN) MIN=TOTAL

  200 CONTINUE

      WRITE(*,*)MIN

      STOP
      END
