import System.IO

prime :: Int -> Int
prime x
  | x < 2 = 0
  | otherwise = length $ remove4Prime [2..x]

remove4Prime :: [Int] -> [Int]
remove4Prime [] = []
remove4Prime (x:xs) = x : remove4Prime [a | a <- xs, mod a x /= 0]

main = do
  done <- isEOF
  if done 
    then return()
    else do
      num <- getLine
      print ( prime $ read  num :: Int )
      main