import Control.Applicative
import Data.List
import Control.Monad

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

answer :: Int ->Int ->Int ->Int ->Int ->Int
answer a b c x y = foldl f 99999999 [0,2..(min (x*2) (y*2))]  where
    f cost c' = min cost (a*(x-div c' 2) + b*(y-div c' 2) + c*c')