import System.IO

main :: IO()
main = do
  end <- isEOF
  if end then return()
  else do
    n <- readLn
    putStrLn . show $ length $ takeWhile (<=n) primesEU
    main

primesEU = takeWhile (<= 1000000) (2 : eulers [3,5..])
  where eulers (p:xs) = p : eulers (xs `minus` map (p*) (p:xs))

minus (x:xs) (y:ys) = case (compare x y) of 
      LT -> x : minus  xs  (y:ys)
      EQ ->     minus  xs     ys 
      GT ->     minus (x:xs)  ys
minus  xs     _     = xs