main = getContents >>= putStrLn . fout . prime_number . fin . lines
fin = map read
fout = unlines . map show

prime_number = map (length . (\n -> takeWhile (<=n) primes))
primes = sieve [2..]
 where sieve (p:xs) = p : sieve [x | x<-xs, (mod x p) /= 0]