main = do
 [a,b,c,x,y] <- map read . words <$> getLine
 let
  buyc   = if a+b<2*c then 0 else min x y * 2
  buyc' = if a<2*c   then 0 else 2*x-buyc + if b<2*c   then 0 else 2*y-buyc
  buya   = max (x-(buyc+buyc')`div`2) 0
  buyb   = max (y-(buyc+buyc')`div`2) 0
 print $ buya*a+buyb*b+(buyc+buyc')*c