data=[[200,380],[300,550],[500,850]]


def price(a,b,c)
	data=[[200,380],[300,550],[500,850]]
	pria=a/5*1520+a%5*data[0][1]
	prib=b/4*1870+b%4*data[1][1]
	pric=c/3*2240+c%3*data[2][1]
	price=pria+prib+pric
	return price
end




while voltotal = gets.chomp.to_i
	break if voltotal == 0



minprice=10000000

vola=0
volb=0
volc=0

a=0
while vola <=5000
	b=0
	c=0
	volb=0
	volc=0
	vola=data[0][0]*a
	vol=vola+volb+volc
	if voltotal==vol
		if minprice > price(a,b,c)
			minprice = price(a,b,c)
		end
	else
		while vola+volb <=5000
			c=0
			volc=0
			volb=data[1][0]*b
			vol=vola+volb+volc
			if voltotal==vol
				if minprice > price(a,b,c)
					minprice = price(a,b,c)
				end
			else
				while vola+volb+volc <=5000
					volc=data[2][0]*c
					vol=vola+volb+volc
					if voltotal==vol
						if minprice > price(a,b,c)
							minprice = price(a,b,c)
						end
					end
					c+=1
				end
			end
			b+=1
		end
	end
	a+=1
end


puts minprice
end