import Data.List

solve :: Int -> [Int] -> [Int] -> [Int] -> Int
solve n (p:_) cl sl
  | n < p^2 = length (cl ++ sl)
  | otherwise = solve n a a (p:sl)
  where a = (cl \\ (map (*p) [1..(div n p)]))

main = getContents >>= mapM_ print . map (\n -> solve n [2] [2..n] []) . map read . words