factors :: Int -> [Int]
factors n = [x | x <- [1..n], n `mod` x == 0]

has8Factors :: Int -> Bool
has8Factors n
  | even n   = False
  | n < 105  = False
  | n == 105 = True
  | otherwise = (== 8) $ length $ factors n

solve :: Int -> Int
solve n = length $ filter has8Factors [1..n]

main :: IO ()
main = do
  n <- readLn
  print $ solve n