#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=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 money=INF;

void func(int gram,int count,int cost){
	if(count==0){
		for(int i=0;i<=gram;i+=100){
			if(moneyA(i)!=INF)func(gram-i,count+1,cost+moneyA(i));
			else func(gram,count+1,cost);
		}
	}else if(count==1){
		for(int i=0;i<=gram;i+=100){
			if(moneyB(i)!=INF)func(gram-i,count+1,cost+moneyB(i));
			else func(gram,count+1,cost);
		}
	}else if(count==2){
		for(int i=0;i<=gram;i+=100){
			if(moneyC(i)!=INF)func(gram-i,count+1,cost+moneyC(i));
			else func(gram,count+1,cost);
		}
	}else{
		if(gram!=0)return;
		else{
			money=min(money,cost);
			return;
		}
	}
	count++;
}


int main(){
	int want;
	while(cin>>want,want){
		money=INF;
		func(want,0,0);
		cout<<money<<endl;
	}
	return 0;
}