local a, b, c, x, y = io.read("*n", "*n", "*n", "*n", "*n")
if(a + b <= c * 2) then
  print(a * x + b * y)
else
  local both = math.min(x, y)
  local price = both * c  * 2
  x, y = x - both, y - both
  price = price + x * math.min(c * 2, a)
  price = price + y * math.min(c * 2, b)
  print(price)
end
