import Data.List

ans (n:p:c:l) =
  let n' = read n :: Int
      [p0,p1] = map read $ words p :: [Int]
      c0 = read c :: Int
      [l0,l1] = take 2 $ reverse $ sort $ map read l :: [Int]

      t0 = if (l1 `div` p1) > (c0 `div` p0)
           then (c0 + l0 + l1) `div` (p0 + 2 * p1)
           else if (l0 `div` p1) > (c0 `div` p0)
                then (c0 + l0) `div` (p0 + p1)
                else c0 `div` p0
  in
    t0

main = do
  c <- getContents
  let o = ans $ lines c
  print o
  