main :: IO ()
main = do
    [ a, b, c, x, y ] <- map ( read :: String -> Int) . words <$> getLine
    let
        prices = [ a, b, c ]
        choices = [ [ na, nb, nc ] |
                        nc <- [0, 2 * x, 2 * y],
                        na <- [0, x, (2 * x - nc + 1) `div` 2],
                        nb <- [0, y, (2 * y - nc + 1) `div` 2],
                        na >= 0,
                        nb >= 0,
                        nc >= 0,
                        2 * na + nc >= 2 * x,
                        2 * nb + nc >= 2 * y]
        result = minimum $ map ( sum . zipWith (*) prices ) choices
    print result
