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

if X == Y
  price += min_a_b * X
  price += min_one if X.odd?
elsif X > Y
  price += min_a_b * Y
  price += [B, C * 2].min if Y.odd?
  price += [A, C * 2].min * (X - Y)
else
  price += min_a_b * X
  price += [A, C * 2].min if X.odd?
  price += [B, C * 2].min * (Y - X)
end

puts price
