A, B, C, X, Y = gets.split.map(&:to_i)

price = 0
min_x = [A, C * 2].min
min_y = [B, C * 2].min
min_a_b = [A + B, C * 2].min

if X == Y
  price += if [min_x, min_y].all? { |p| p == C * 2 }
             C * 2 * X
           else
             min_x * X + min_y * Y
           end
elsif X > Y
  price += min_a_b * Y
  price += min_y if Y.odd?
  price += min_x * (X - Y)
else
  price += min_a_b * X
  price += min_x if X.odd?
  price += min_y * (Y - X)
end

puts price
