def discount(a,b,c)
	discount = [380, 330, 306]
	price = 380*a + 550*b + 850*c
	price -= discount[0]*(a/5) + discount[1]*(b/4) + discount[2]*(c/3)
	price
end

def get_least_price(n)
	price_min = 10000000
	a_max, b_max, c_max = [n/200, n/300, n/500]
	0.upto(a_max)do |a|
		0.upto(b_max) do |b|
			0.upto(c_max) do |c|
				price_temp = discount(a,b,c)
				amount_temp = 200*a + 300*b + 500*c
				price_min = price_temp if n <= amount_temp && price_temp < price_min
			end
		end
	end
	price_min
end

while gets
	amount = $_.chomp.to_i
	break if amount.zero?
	puts get_least_price(amount)
end