import Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInteger
readIntList = map readInt . BS.words
getIntList = readIntList <$> BS.getLine

data PizzaPrice = PizzaPrice{
priceA :: Integer,
priceB :: Integer,
priceC :: Integer
}

data ReqNum = ReqNum{
quantityX :: Integer,
quantityY :: Integer
}

type Price = Integer

halfAndHalf :: PizzaPrice -> ReqNum -> Price
halfAndHalf pp rn
            | a + b < 2 * c = a * x + b * y
            | x > y = min ((y * 2 * c)  + ( (x - y) * a)) (x * 2 * c)
            | otherwise = min ((x * 2 * c)  + ( (y - x) * b)) (y * 2 * c)
            where
                a = priceA pp
                b = priceB pp
                c = priceC pp        
                x = quantityX rn
                y = quantityY rn                

                
main = do
     [a,b,c,x,y] <- getIntList
     print $ halfAndHalf (PizzaPrice a b c) (ReqNum x y)