import Data.List.Split
import Data.Ord

main = do
	str <- getLine
	let spl = splitOn " " str
	let str' = map (\x -> read x :: Integer) spl
	let a = str' !! 0
	let b = str' !! 1
	let c = str' !! 2
	let x = str' !! 3
	let y = str' !! 4
	let common = min x y
	let rest = (max x y) - common
	let single = min a b
	let result = (getMinCommon a b c common) + (getMinOver single c rest)
	putStrLn $ show result
	
getMinCommon :: Integer -> Integer -> Integer -> Integer -> Integer
getMinCommon a b ab amount = min x y
	where
		x = ab * amount * 2
		y = (a + b) * amount

getMinOver :: Integer -> Integer -> Integer -> Integer
getMinOver single double amount = min x y
	where
		x = amount * single
		y = amount * 2 * double

