primes :: Int -> [Int] ->  Int -> [Int]
primes i l n | i > n = l
             | otherwise = primes (i+1) res n
                where res = filter (\x -> x`mod`i /= 0 || x == i) l


primeNumber :: Int -> Int
primeNumber n = length $ primes 2 [2..n] l
  where l = ceiling . sqrt . realToFrac $ n

main = interact (unlines . map (show . primeNumber . read) . lines)