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

def main(a, b, c, x, y)
  count_ab = ([x, y].max)*2
  min_price = Float::INFINITY
  (0..count_ab).reverse_each do |c_ab|
    c_a = [x - c_ab.div(2), 0].max
    c_b = [y - c_ab.div(2), 0].max
    price = c_a * a + c_b * b + c_ab * c
    min_price = price if price < min_price
  end
  return min_price
end

puts main(n, m, scores)