      integer f(0:8190 )
      integer i, p, k, c, n
      do 12500 n = 1, 10
         c = 0
      do 10000 i000 = (  0), ( 8190 ), 1
         f(i000) = 1
10000 continue
      do 12501 i = 0, 8190
            if ( f(i) .ne.  0 ) then
               p = 2*i + 3
               k = i + p
17500 continue
      if (.not.( k .le.  8190  )) goto 15000
                  f(k) = 0
                  k = k + p
      goto 17500
15000 continue
               c = c + 1
            end if
12501 continue
12500 continue
      write(*,*) c, ' primes'
      stop
      end
