import Control.Monad
import Control.Applicative
import Data.List

main = do
  xs <- (map read . lines) <$> getContents :: IO [Int]
  mapM_ print $ pnsz xs

pnsz :: [Int] -> [Int]
pnsz [] = []
pnsz (n:ns) = length (takeWhile (<= n) pn) : pnsz ns
  where
    pn = 2 : f [3,5..999999]
      where f (p:ps) = p : f [x | x <- ps, x `mod` p /= 0]