{-# OPTIONS_GHC -O2 -funbox-strict-fields #-}
import qualified Data.ByteString.Char8 as BC
import           Data.Maybe            (fromJust)

main :: IO ()
main = do
  [a, b, c, x, y] <- map readInt . BC.words <$> BC.getLine
  print $ solve a b c x y

solve :: Int -> Int -> Int -> Int -> Int -> Int
solve a b c x y
  | x > y     = solve' a b c x y
  | otherwise = solve' b a c y x

solve' a b c x y
  | a > c         = 2 * c * x
  | a + b > 2 * c = a * (x - y) + 2 * c * y
  | otherwise     = a * x + b * y

readInt :: BC.ByteString -> Int
readInt = fst . fromJust . BC.readInt
