{-# LANGUAGE MultiWayIf #-}

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