import Control.Monad
import Control.Applicative
import Data.Functor
import Data.List
import Data.Char

readInt = readLn :: IO Int
readInts = map read . words <$> getLine :: IO [Int]
cond t f c = if c then t else f
-- end of templete

primes :: [Int]
primes = primes' [2..]
  where
    primes' (p:l) = (p : primes' [x | x <- l, mod x p /= 0])


main = map read . lines <$> getContents >>= mapM_ (print . length . flip takeWhile primes . (>=))