def min(a, b)
  return (a < b) ? a : b
end

def abs(a)
  return a.abs
end

def how_pizza_buy(a, b, c, x, y)
  if a+b < c*2 then
    return a*x+b*y 
  else
    return min(x,y)*2*c+abs(x-y)*c
  end
end

a, b, c, x, y = gets.chomp.split.map(&:to_i)

puts how_pizza_buy(a, b, c, x, y)
