main :: IO ()
main = do
    cs <- getContents
    let line = map toInt (lines cs)
        max = maximum line
        pl = prime max
        solve = solveR(pl)
    putStr $ unlines $ map solve line

solveR :: [Int] -> Int -> String
solveR l n = show $ length [x | x <- l, x <= n]

toInt :: String -> Int
toInt s = read s :: Int

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]