solve :: Int -> Int -> Int -> Int -> Int -> Int
solve a b c x y = minimum [l, m, n a, n b]
    where
        l = a * x + b * y
        m = 2 * c * max x y
        n o = (2 * c * min x y) + (o * (abs $ x-y :: Int))

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