#include <iostream>

using namespace std;

int main() {
	int n, m = 5000 * 500;
	cin >> n;
	if (n == 0){
		return 0;
	}
	for (int i = n / 500; i >= 0; i--) {
		for (int j = n / 300; j >= 0; j--) {
			for (int k = n / 200; k >= 0; k--) {
				int w = i * 500 + j * 300 + k * 200;
				if (w == n) {
					int p = (i / 3 * 3 * 0.88 + i % 3) * 850 + (j / 4 * 4 * 0.85 + j % 4) * 550 + (k / 5 * 5 * 0.8 + k % 5) * 380;
					if (p < m) {
						m = p;
					}
				}
			}
		}
	}
	cout << m << endl;
	return main();
}