import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.container;

void main()
{
	auto weight = [1000, 1200, 1500, 200, 300, 500];
	auto tplace =  [380*5*0.8, 550*4*0.85, 850*3*0.88, 380, 550, 850];
	auto place = tplace.map!(to!int).array;

	int n;
	while (n = readln.chomp.to!int, n) {
		int res = int.max;
		bool f[6];
		void solve(int sum, int w, int cnt) {
			if (cnt == 6) {
				if (!w) {
					res = min(sum, res);
				} 
				return;
			}
			foreach (i; 0..6) {
				if (f[i]) continue;
				f[i] = 1;
				auto t = w / weight[i];
				solve(sum + t*place[i], w % weight[i], cnt+1);
				f[i] = 0;
			}
		}
		solve(0, n, 0);
		res.writeln;
	}
}