module Main(main) where
import Data.List

attack katana h =
  let as = map head katana
      bs = map (head . tail) katana
      ma = foldl max 1 as
      tk = sort $ filter (> ma) bs
      simulate :: Int -> Int -> [Int] -> Int
      simulate cnt rest [] =
        if rest > ma then simulate (cnt+1) (rest - ma) []
        else cnt+1
      simulate cnt rest (x:xs) =
        if rest > x then simulate (cnt+1) (rest - x) xs
        else cnt+1
  in simulate 0 h tk

main :: IO ()
main = do
  [n,h] <- map read . words <$> getLine :: IO [Int]
  katana <- (map $ map read . words) <$> (sequence $ replicate n getLine) :: IO [[Int]]
  print $ attack katana h

