import Control.Applicative ((<$>))

main :: IO ()
main = solve <$> map read <$> words <$> getLine >>= print

solve :: [Int] -> Int
solve [a, b, c, x, y]
  | a + b <= 2 * c = a * x + b * y
  | x > y && a > 2 * c = 2 * c * x
  | x > y = 2 * c * y + (x - y) * a
  | b > 2 * c = 2 * c * y
  | otherwise = 2 * c * y + (y - x) * b
