import Control.Applicative
import Control.Monad
import Data.List
import Data.Array
import Data.Char

main = do
  [a, b, c, x, y] <- map (read::String -> Int) . words <$> getLine
  let (d, e, z, w) = if x < y then (b, a, y, x) else (a, b, x, y)
    in print $ if d + e <= 2 * c
      then d * z + e * w
      else if d <= 2 * c
        then 2 * c * w + a * (z - w)
        else 2 * c * z