PROGRAM ask

  IMPLICIT NONE
  INTEGER, PARAMETER :: u = 15
  INTEGER :: n, k, i, b

  OPEN (unit = u, file="rndint", action = "read", status = "old")


  READ (u,*) n

  k = 0
  DO i=1,n
     READ (u,*) b
     IF (b > 2999) k = k + 1
  ENDDO

  CLOSE (u)

  PRINT *, k
END PROGRAM ask
