import Data.Functor
import Data.Numbers.Primes

main = do
  n <- getRows <$> getContents
  mapM_ print $ map (\x -> length $ takeWhile (<= x) primes) n


getRows s = map (read :: (String -> Int)) $ lines s