def price(a,b,c)
	pria=a/5*1520+a%5*380
	prib=b/4*1870+b%4*550
	pric=c/3*2240+c%3*850
	price=pria+prib+pric
	return price
end

50.times{
	m = gets.to_i
	if m == 0
		break
	end
	min=9999

	for i in 0..m/200
		for j in 0..m/300
			for k in 0..m/500
				vol=i*200+j*300+k*500
				if m==vol
					if min > price(i,j,k)
						min = price(i,j,k)
					end
				end
			end
		end
	end
	puts min
}