#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define pb push_back

using namespace std;

int price(int a, int b, int c) {
	return 380 * (a / 5 * 5) * 0.8 + 380 * (a % 5) +
			550 * (b / 4 * 4) * 0.85 + 550 * (b % 4) +
			850 * (c / 3 * 3) * 0.88 + 850 * (c % 3);
}

int main() {
	//freopen("0106.inp", "r", stdin);
	int n; cin >> n;
	while (n != 0) {
		int p = 100000;
		loop(c, 0, n / 500 + 1) {
			int p1 = n - 500 * c;
			loop(b, 0, p1 / 300 + 1) {
				int p2 = p1 - 300 * b;
				if ((p2 >= 0) && (p2 % 200 == 0)) {
					int a = p2 / 200;
					p = min(p, price(a, b, c));
					//cout << a << ' ' << b << ' ' << c << endl;
				}
			}
		}
		cout << p << endl;
		cin >> n;
	}
}