import System.IO

primes = 2 : sieve [3, 5 ..]
    where sieve (p : xs) = p : sieve [x | x <- xs, rem x p /= 0]
 
main = do
    end <- isEOF
    if end then return ()
    else do
        n <- readLn :: IO Int
        print $ length $ takeWhile (<= n) primes
        main