main = do
    ns <- fmap (map read . lines) getContents :: IO [Int]
    mapM_ putStrLn $ map primeslen ns
primes :: [Int] -> [Int]
primes [] = []
primes (x:xs) = x : primes [y | y <- xs, mod y x /= 0]
primeslen :: Int -> String
primeslen n = show . length $ primes [2..n]