import qualified Data.Vector as V
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as MP
import qualified Data.Set as ST
import qualified Data.Sequence as SQ
import Data.Array
import Data.Array.Unboxed
import Data.Array.ST
import Data.Array.IO
import Data.Maybe
import Data.Ratio
import Data.Char
import Data.Bits
import Data.List
import Data.Tuple
import Data.Functor
import Data.IORef
import Data.STRef
import Control.Applicative
import Control.Monad
import Control.Monad.ST


solve a b c x y
  | c < a && c < b = 2 * c * max x y
  | otherwise = 
      minimum [i * a + j * b + k * c * 2 | i <- [0..x], j <- [0..y], let k = max (x-i) (y-j)]

main = do
  [a,b,c,x,y] <- map read . words <$> getLine :: IO [Int]
  print $ solve a b c x y

