module Main where

import Control.Applicative
import Control.Monad

main :: IO ()
main = do
    [a, b, c, x, y] <- fmap read . words <$> getLine
    let uxy = min (a + b) (2 * c)
    let ux = min a (2 * c)
    let uy = min b (2 * c)
    let amt1 = uxy * (min x y)
    let amt2 = case x `compare` y of
            EQ -> 0
            LT -> uy * (y - x)
            GT -> ux * (x - y)
    print $ amt1 + amt2