#include<iostream>
#include<algorithm>
#include<map>
#include<unordered_map>
#include<string>
#include<utility>
#define INF 2<<29
using namespace std;
	int n;
	double price [3] = { 850,550,380 };
	double discount[3] = { 0.88,0.85,0.8 };
	double  group[3] = { 3.0,4.0,5.0 };
	double gram[3] = { 500.0,300.0,200.0 };
	vector<int> dp(5001, INF);
	int memo;
	int ans = 0;
	int amount = 0;
int main() {
		for (int i = 0; i <= 10; ++i) {
			for (int j = 0; j <= 17; ++j) {
				for (int k = 0; k <= 25; ++k) {
					amount = i*gram[0] + j*gram[1] + k*gram[2];
					if (amount > 5000)break;
					int warihukuro[3] = { (int)(i / 3) * 3,(int)(j / 4) * 4,(int)(k / 5) * 5 };
					memo = warihukuro[0] * price[0] * discount[0] + (i - warihukuro[0])*price[0] +
						warihukuro[1] * price[1] * discount[1] + (j - warihukuro[1])*price[1] +
						warihukuro[2] * price[2] * discount[2] + (k - warihukuro[2])*price[2];
					//cout << amount << " " << memo << endl;
					dp[amount] = min(memo, dp[amount]);
				}
			}
		}
		while(cin>>n&&n)
		cout << dp[n] << endl;
	
	return 0;
}
