import qualified Data.ByteString.Lazy.Char8 as B
import Data.List
import Data.Maybe
import Debug.Trace

traceQ :: (Show a) => String -> a -> a
-- traceQ label a = trace (label ++ ": " ++ show a) a
traceQ _ a = a

bsReadInts :: B.ByteString -> [Int]
bsReadInts = map (fst . fromJust . B.readInt) . B.words

solve :: Int -> Int -> [Int] -> [Int] -> Int
solve valN valH as bs =
  case [(i, sum) | (i, sum) <- sc, sum >= valH] of
    (ans, _) : _ -> ans
    [] -> (fst lastres) + (((valH - (snd lastres)) + (amax - 1)) `div` amax)
  where
    amax = maximum (traceQ "as" as)
    effBs = reverse $ sort $ filter (> amax) bs
    sc = scanl op (0, 0) (traceQ "effBs" effBs)
      where op (i, sum) h = (i + 1, sum + h)
    lastres = last sc

eoSplit :: [Int] -> ([Int], [Int])
eoSplit [] = ([], [])
eoSplit (o:e:xs) = (o:os, e:es)
  where (os, es) = eoSplit xs

main :: IO ()
main = do
  conts <- B.getContents
  let valN : valH : rest = bsReadInts conts
      (as, bs) = eoSplit rest
      x = solve valN valH as bs
  putStrLn $ show x
  
