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

int main(){
	int m;
	while(cin>>m&&m){
		int ans=1<<30;
		for(int i=0;i<=(m+499)/500;i++){
			int a=i/3*3*850*88/100;
			a += i%3*850;
			for(int j=0;j<=max(0,(m-i*500+299)/300);j++){
				int b=j/4*4*550*85/100;
				b += j%4*550;
				int k=(m-i*500-j*300+199)/200,c;
				c=k/5*5*380*80/100;
				c += k%5*380;
				ans=min(ans,a+b+c);
			}
		}
		cout<<ans<<endl;
	}
	return 0;
}