halfAndHalf :: [Int] -> Int
halfAndHalf [a,b,c,x,y]
    | x > y     = minValue y + remValue (x - y) a
    | otherwise = minValue x + remValue (y - x) b
    where
        minValue n = if a + b < 2 * c then (a + b) * n else 2 * c * n
        remValue n v = if v < 2 * c then v * n else 2 * c * n

main :: IO ()
main = do
    input <- map read . words <$> getLine
    putStrLn . show $ halfAndHalf input