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

price = 0
min_one = [A, B, C * 2].min
min_a_b = [A + B, C * 2].min
min_two_a = [A * 2, C * 4].min
min_two_b = [B * 2, C * 4].min

if X == Y
  price += min_a_b * (X / 2)
  price += min_one if X.odd?
elsif X > Y
  price += min_a_b * Y
  price += min_one if Y.odd?
  diff = X - Y
  price += min_two_a * (diff / 2)
  price += min_one if diff.odd?
else
  price += min_a_b * X
  price += min_one if X.odd?
  diff = Y - X
  price += min_two_b * (diff / 2)
  price += min_one if diff.odd?
end

puts price
