#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	while(cin>>n,n){
		n/=100;
		int num[]={1000000,1000000,1000000};
		if(n%2==0)num[0]=380*(n/10)*5*0.8+n%10/2*380;
		if(n%3==0)num[1]=550*(n/12)*4*0.85+n%12/3*550;
		if(n%5==0)num[2]=850*(n/15)*3*0.88+n%15/5*850;
		cout<<min(min(num[0],num[1]),num[2])<<endl;
	}
}