#include<iostream>
#include<cstdlib>

using namespace std;

int main(void) {
	int in, price;

	while(true) {
		cin >> in;
		if(in == 0) { break; }
		price = 0;
		while(in > 0) {
			if(in == 1500 || abs(1500-in/2) <= abs(1000-in/2)) {
				price += 2244;
				in -= 1500;
			} else if(in == 1000 || abs(1000-in/2) >= abs(1200-in/2)) {
				price += 1520;
				in -= 1000;
			} else if(in == 1200 || abs(1200-in/2) <= abs(500-in/2)) {
				price += 1870;
				in -= 1200;
			} else if(in == 500 || abs(500-in/2) <= abs(300-in/2)) {
				price += 850;
				in -= 500;
			} else if(in == 300 || abs(300-in/2) <= abs(200-in/2)) {
				price += 550;
				in -= 300;
			} else {
				price += 380;
				in -= 200;
			}
		}
		cout << price << endl;
	}

	return 0;
}