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

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

type Price = Integer
type NumOfPizza = Integer

halfAndHalf :: Price -> Price -> Price -> NumOfPizza -> NumOfPizza -> Price
halfAndHalf a b c x y
            | abLT2c = a * x + b * y
            | x > y = min (costOf2Y + costOfrestA) costOf2X
            | otherwise = min (costOf2X + costOfrestB) costOf2Y
            where
                abLT2c = if a + b < 2 * c then True else False
                costOf2Y = y * 2 * c
                costOfrestA = (x - y) * a
                costOf2X = (x * 2 * c)
                costOfrestB = (y - x) * b

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