#include <iostream>

using namespace std;

int main(){
	int n;
	while(1){
		int min = 1000000;
		cin >> n;
		if(!n) break;
		for(int i=0;i <= n/500;i++){
			for(int j=0;j <= (n-i*500)/300;j++){
				int k,cost;
				if((n - i*500-j*300) % 200 != 0) continue;
				k = (n - i*500-j*300) / 200;
				cost = 748*((i/3)*3)*+850*(i % 3)+1870*(j/4)+550*(j % 4)+304*((k/5)*5)+380*(k % 5);
				if(min > cost) min = cost;
			}
		}
		
		cout << min << endl;
	}
	
	return 0;
}