#include <iostream>
using namespace std;
int f(int weight){
	int tw[] = {500,300,200},b[3],tp[] = {850,550,380},c[3],price = 0,tmp,d;
	double a[] = {0.88,0.85,0.80};
	for(int i = 0;i < 3;++i){
		d = (tw[i] * (i + 3));
		if((weight % d) == 0){
			return (int)((double)(weight / tw[i] * tp[i]) * a[i]);
		}
		tmp = weight;
		b[i] = tmp / (tw[i] * (i + 3)) * (i + 3);
		tmp -= (tw[i] * b[i]);
		price += (int)((double)(b[i] * tp[i]) * a[i]);
		for(int j = i + 1;j < 3;++j){
			b[j] = tmp / (tw[j] * (j + 3)) * (j + 3);
			tmp -= (tw[j] * b[j]);
			price += (int)((double)(b[j] * tp[j]) * a[j]);
			if(tmp < 0){
				price = 0;
				break;
			}
			else if(tmp == 0){
				return price;
			}
		}
		if((weight % tw[i]) == 0){
			d = weight / d * (i + 3);
			c[0] = (weight - (tw[i] * d)) / tw[i];
			return (int)((double)(d * tp[i]) * a[i]) + (c[0]* tp[i]);
		}
	}
	price = 0;
	for(int i = 0;i < 3;++i){
		b[i] = weight / tw[i];
		weight -= tw[i] * b[i];
		c[i] = b[i] / (i + 3) * (i + 3);
		b[i] -= c[i];
		price += (int)((double)(tp[i] * c[i]) * a[i]) + (tp[i] * b[i]);
	}
	return price;
}
int main(){
	int n;
	while(cin >> n && n){
		cout << f(n) << endl;
	}
	return 0;
}