import Data.Int (Int64)
import Data.List (sortBy, transpose)

divCeil :: Integral a => a -> a -> a
divCeil a b = (a + b - 1) `div` b

solve :: Integral a => a -> [a] -> [a] -> a
solve h as bs = f 1 h fs
    where
        a = maximum as
        fs = takeWhile (>= a) $ sortBy (flip compare) $ as ++ bs
        f i s [] = i - 1 + divCeil s a
        f i s (x : xs) = if s - x <= 0 then i else f (i + 1) (s - x) xs

main :: IO ()
main = do
    [_, h] <- fmap read . words <$> getLine :: IO [Int64]
    [xs, ys] <- transpose . fmap (fmap read . words) . lines <$> getContents
    print $ solve h xs ys
