import Control.Applicative

main = do 
    [a,b,c,x,y] <- map read . words <$> getLine
    print $ solve a b c x y

solve :: Int -> Int -> Int -> Int -> Int -> Int
solve a b c x y = z*d + e*(x-z) + f*(y-z)
    where z = min x y
          d = min (2*c) (a+b)
          e = min (2*c) a
          f = min (2*c) b
