solve :: Int -> Int -> Int -> Int -> Int -> Int
solve a b c x y
  | a + b <= 2 * c = a * x + b * y
  | x < y = 2 * c * x + (y - x) * (min b (2 * c))
  | True = 2 * c * y + (x - y) * (min a (2 * c))

main :: IO ()
main = do
  a:b:c:x:y:_ <- fmap (\x -> read x :: Int) <$> words <$> getLine
  print $ solve a b c x y
