#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
	while (1)
	{
		int a;
		cin >> a;
		if (a == 0)break;
		int m, s;
		m = s = 1000000;
		for (int b = 0; b <=a / 200; b++) {
			for (int c = 0; (b * 200 + c * 300) <= a; c++) {
				if ((a - (b * 200 + c * 300)) % 500 != 0)continue;
				m =  (b / 5) * 1520;
				m += (b % 5) * 380;
				m += (c / 4) * 1870;
				m += (c % 4) * 550;
				m += (((a - b * 200 - c * 300) / 500)/3) * 2244;
				m += (((a - b * 200 - c * 300) / 500) % 3) * 850;
				if (m < s)s = m;
			}
		}
		cout << s << endl;
	}
}