#include <iostream>
#include <algorithm>
using namespace std;

#define INF 10000000

int A(int m) {
	int n = m / 200;
	int ret = 0;

	if(m % 200)
		return INF;
	ret += (n / 5) * 5 * 380 * 80 / 100;
	ret += n % 5 * 380;
	
	return ret;
}
int B(int m) {
	int n = m / 300;
	int ret = 0;

	if(m % 300)
		return INF;
	ret += (n / 4) * 4 * 550 * 85 / 100;
	ret += n % 4 * 550;

	return ret;
}
int C(int m) {
	int n = m / 500;
	int ret = 0;

	if(m % 500)
		return INF;
	ret += (n / 3) * 3 * 850 * 88 / 100;
	ret += n % 3 * 850;

	return ret;
}

int main() {
	int m;
	int table[64];

	for(int i = 0; i < 64; i++) {
		table[i] = A(i * 100);
	}

	for(int i = 63; i >= 0; i--) {
		for(int j = 0; j <= i; j++) {
			table[i] = min(table[i], table[i - j] + B(j * 100));
		}
	}
	for(int i = 63; i >= 0; i--) {
		for(int j = 0; j <= i; j++) {
			table[i] = min(table[i], table[i - j] + C(j * 100));
		}
	}

	while(cin >> m, m) {
		cout << table[m / 100] << endl;
	}

	return 0;
}