price_a_pizza, price_b_pizza, price_ab_pizza, num_need_a_pizza, num_need_b_pizza = gets.split.map(&:to_i)

if price_a_pizza > price_ab_pizza && price_b_pizza > price_ab_pizza
	price_min = price_ab_pizza*2 * (num_need_a_pizza < num_need_b_pizza ? num_need_b_pizza : num_need_a_pizza)
	puts price_min
else
	if price_a_pizza + price_b_pizza > price_ab_pizza * 2
		if num_need_a_pizza > num_need_b_pizza
			price_min = price_ab_pizza*2 * num_need_b_pizza + (num_need_a_pizza - num_need_b_pizza) * price_a_pizza
			puts price_min
		else
			price_min = price_ab_pizza*2 * num_need_a_pizza + (num_need_b_pizza - num_need_a_pizza) * price_b_pizza
			puts price_min
		end
	else
		price_min = price_a_pizza * num_need_a_pizza + price_b_pizza * num_need_b_pizza
		puts price_min	
	end
end