#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;

int dp[4][10000];
int v[3] = { 2,3,5 }, w[3] = { 380,550,850 };

int main() {
	memset(dp, 127, sizeof(dp));
	dp[0][0] = 0;
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 9000; j++) {
			for (int k = j; k < 10000; k += v[i]) {
				dp[i + 1][k] = min(dp[i + 1][k], dp[i][j] + (k - j) / v[i] * w[i]);
			}
		}
	}
	while (true) {
		int n;
		cin >> n;
		if (n == 0) { break; }
		cout << dp[3][n % 100] << endl;
	}
	return 0;
}