import Control.Applicative

solver :: Int -> Int
solver n
  | n < 2     = 0
  | otherwise = length $ primeFilter [2..n]


primeFilter :: [Int] -> [Int]
primeFilter []     = []
primeFilter (p:xs) = p : primeFilter [x | x <- xs, x `mod` p /= 0]

main :: IO()
main = do
  input <- map read . lines <$> getContents
  mapM_ (print . solver) input