import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  xs <- inpi toInt
  mapM_ print $ solve xs

solve :: [Int] -> [Int]
solve = map npn

npn :: Int -> Int
npn n = length . takeWhile (<= n) $ primes

primes :: [Int]
primes = 2 : sieves [3,5..]

sieves :: [Int] -> [Int]
sieves (p:ps) = p : sieves [i | i <- ps, i `mod` p /= 0]

toInt :: String -> Int
toInt s = read s

inpi :: (String -> a) -> IO [a]
inpi f = map f . lines <$> getContents