import Control.Applicative

main = getContents >>= mapM_ (print . solve . map read . words) . lines

solve :: [Int] -> Int
solve x = length $ primes 2 n [2..n]
  where n = head x

primes :: Int -> Int -> [Int] -> [Int]
primes n m xs
  | m == 1 = []
  | m == 2 = [2]
  | n * n > m = xs
  | elem n xs == False = primes (n+1) m xs
  | otherwise =  primes (n+1) m $ filter (\x -> x == n || x `mod` n /= 0) xs