module Main (main) where
import Data.Function
import Control.Monad
import System.IO
primes :: [Int]
primes = filterPrime [2..]
  where filterPrime (p:xs) =
          p : filterPrime [x | x <- xs, x `mod` p /= 0]

main :: IO ()
main = do
     fix $ \loop -> do
       eof <- isEOF
       unless eof $ do
         n <- readLn
         print $ length . takeWhile (<=n) $ primes
         loop