f2 :: Int->Int
f2 x
   |x<=0 = 0
   |otherwise=x


f :: Int->Int->Int->Int->Int->Int->[Int]
f a b c s x y
    |x<0 && y<0 = []
    |otherwise = (s + a * (f2 x) + b * (f2 y)) : f a b c (s+c) (x-1) (y-1)


main =do
      e<-getLine
      let (a:b:c:x:y:[])=map read (words e)::[Int]
      putStrLn $ show $ minimum $ f a b (c*2) 0 x y