#include <iostream>
using namespace std;
#define gram_a 200
#define gram_b 300
#define gram_c 500
#define yen_a 380
#define yen_b 550
#define yen_c 850
#define set_a 5
#define set_b 4
#define set_c 3
#define dis_a 0.8
#define dis_b 0.85
#define dis_c 0.88
/*
int main() {
	int n,a, b, c;
	a = 0;
	b = 0;
	c = 0;
	while (1) {
		cout << "a = " << a << " b = " << b << " c = "<<c << endl;
		cout << "g = " << gram_a * a + gram_b * b + gram_c * c << endl;
		cout <<"y = "<< set_a * ((int)(a / set_a))*yen_a*dis_a + (a%set_a)*yen_a +
			set_b * ((int)(b / set_b))*yen_b*dis_b + (b%set_b)*yen_b +
			set_c * ((int)(c / set_c))*yen_c*dis_c + (c%set_c)*yen_c
			<< endl;
		cin >> n;
		if (n == 1)
			c++;
		if (n == 2) {
			b++;
			c = 0;
		}
		if (n == 3) {
			a++;
			b = 0;
			c = 0;
		}
	}

}
*/

int main() {
	int n;
	while (cin >> n) {
		if (n == 0)
			break;
		int i, a = 0, b = 0, c = 0, min = 0, y, g;
		bool f=true, brk=false;
		for (a = 0;; a++) {
			for (b = 0;; b++) {
				for (c = 0;; c++) {
					brk = false;
					g = gram_a * a + gram_b * b + gram_c * c;
					if (n == g) {
						y = set_a*((int)(a / set_a))*yen_a*dis_a + (a%set_a)*yen_a +
							set_b*((int)(b / set_b))*yen_b*dis_b + (b%set_b)*yen_b +
							set_c*((int)(c / set_c))*yen_c*dis_c + (c%set_c)*yen_c;
						if (min > y || f) {
							min = y;
							f = false;
						}
						break;
					}
					if (n<g) {
						if (c == 0)
							brk = true;
						break;
					}
				}
				if (brk) {
					if (b > 0)
						brk = false;
					break;
				}
			}
			if (brk)
				break;
		}
		cout << min << endl;
	}
}
