#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;i++)
using namespace std;
typedef long long ll;
typedef pair<string, int>P;

int main() {
	int n;
	while (cin >> n, n) {
		int Min = INT_MAX;
		rep(i, n / 200 + 1) {
			rep(j, n / 300 + 1) {
				rep(k, n / 500 + 1) {
					if (i * 200 + j * 300 + k * 500 == n) {
						Min = min(Min, 380 * i + 550 * j + 850 * k - i / 5 * 380 - j / 4 * 330 - k / 3 * 306);
					}
				}
			}
		}
		cout << Min << endl;
	}
}