import Control.Monad
import Data.List
main = do
  [n, k] <- (map read . words) <$> getLine
  ab <- map (map read . words) <$> replicateM n getLine
  putStrLn $ show $ solve k ab

solve:: Int -> [[Int]] -> Int
solve k ab = chu k 0 ma b
  where
    ma = maximum [ x | [x, _] <- ab ]
    b = sortOn negate $ [ b | [_, b] <- ab, b > ma ]

chu:: Int -> Int -> Int -> [Int] -> Int
chu h n ma []
  | h <= 0 = n
  | otherwise = chu (h - ma) (n + 1) ma []
chu h n ma (b:bs)
  | h <= 0 = n
  | otherwise = chu (h - b) (n + 1) ma bs
