import Control.Applicative

main = do
  n <- read <$> getLine
  print $ length $ primes 2 n [2..n-1]



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