#include <iostream>

using namespace std;

int soba[][2] = {
	{1200, 1870},
	{1000, 1520},
	{1200, 1870},
	{1000, 1520},
	{500, 850},
	{300, 550},
	{200, 380}
};

int main() {
	int n;
	cin >> n;
	if (n) {
		int ans = 0;
		for (int i = 0; i < 6; i++) {
			ans += n / soba[i][0] * soba[i][1];
			n %= soba[i][0];
		}
		if (n) {
			ans += soba[5][0];
		}
		cout << ans << endl;
		main();
	}
	return 0;
}