# Cがお買い得かどうかをチェック
def good_deal?(a_gap, b_gap)
	return false if a_gap >= 0 && b_gap >= 0
	return true if a_gap < 0 && b_gap < 0

	if (a_gap > 0) && (b_gap.abs - a_gap > 0) || (b_gap > 0) && (a_gap.abs - b_gap > 0)
		true
	else
		false
	end
end

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

a_gap =  (c / 2) - (a / 2)
b_gap =  (c / 2) - (b / 2)

puts (a * x + b * y) unless good_deal?(a_gap, b_gap)

if good_deal?(a_gap, b_gap)
	if (b_gap < 0) && (a_gap < 0)
		puts ([x,y].max * 2 * c)
	elsif (b_gap < 0)
		if (x <= y)
			puts (y*2) * c
		else
			puts (y*2) * c + a * (x-y)
		end
	elsif (a_gap < 0)
		if (y <= x)
			puts (x*2) * c
		else
			puts (x*2) * c + b * (y-x)
		end 
	end
end