main :: IO ()
main = do
    cs <- getContents
    putStr $ unlines $ map solve $ lines cs

solve :: String -> String
solve s = show $ length $ prime $ read s

recursion :: [Int] -> [Int]
recursion [] = []
recursion (m:ms) = m : recursion [x | x<-ms, x `mod` m /= 0]

prime :: Int -> [Int]
prime 1 = []
prime 2 = [1]
prime x = recursion [2..x]