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

price = 0
if X == Y
  price += if C * 2 <= A || C * 2 <= B
             C * 2 * X
           else
             A * X + B * Y
           end
else
  if C * 2 <= A && C * 2 <= B
    price += C * 2 * [X, Y].max
  elsif C * 2 <= A + B
    price += C * 2 * [X, Y].min
    price += (X < Y ? B : A) * (X - Y).abs
  elsif C * 2 <= A
    price += C * 2 * X
    diff = Y - X
    price += B * diff if diff.positive?
  elsif C * 2 <= B
    price += C * 2 * Y
    diff = X - Y
    price += A * diff if diff.positive?
  else
    price += A * X + B * Y
  end
end

puts price
