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
  num <- getLine
  let
    nn = read num :: Int
  if null num
    then return()
    else do
      print ( prime nn )
      main