{-# LANGUAGE MultiWayIf #-}

main :: IO ()
main = do
  [a,b,c,x,y] <- map read.words <$> getLine :: IO [Int]
  let avg = (a+b)`div`2
  print $ if | avg < c -> a*x+b*y
             | 2*c < avg -> c*max x y*2
             | c < avg -> if | x < y -> (y-x)*b + c*x*2
                             | otherwise -> (x-y)*a + c*y*2
