main = do
  s <- getContents
  let primes = 2 : filter (\n -> foldr (\x acc -> x * x > n || (n `mod` x /= 0 && acc)) True primes) [3..]
  mapM_ (\n -> print $ length $ takeWhile (<= n) primes) . map read . lines $ s