#include<iostream>
#include<cmath>
#include<string>
#include<cstring>
#include<cstdlib>
#define INF 100000
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
using namespace std;

int moneyA(int gram){
	int n=gram/200;
	int res=gram%200;
	if(res)return INF;
	int money=0;
	int sell=n/5;
	int normal=n%5;
	money=(int)((double)sell*5*380*0.8)+normal*380;
	return money;
}

int moneyB(int gram){
	int n=gram/300;
	int res=gram%300;
	if(res)return INF;
	int money=0;
	int sell=n/4;
	int normal=n%4;
	money=sell*4*550*0.85+normal*550;
	return money;
}

int moneyC(int gram){
	int n=gram/500;
	int res=gram%500;
	if(res)return INF;
	int money=0;
	int sell=n/3;
	int normal=n%3;
	money=sell*3*850*0.88+normal*850;
	return money;
}
int main(){
	int want;
	while(cin>>want,want){
		cout<<min(min(moneyA(want),moneyB(want)),moneyC(want))<<endl;
	}
	return 0;
}