import Control.Monad

main = do
    n <- read <$> getLine
    putStrLn $ show $ solve n

solve :: Int -> Int
solve n | n < 105   = 0
        | n < 135   = 1
        | n < 165   = 2
        | n < 189   = 3
        | n < 195   = 4
        | otherwise = 5
