#include<vector>
#include<list>
#include<algorithm>
#include<iostream>
#include<string>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;
int f(int g[],int m[],int gg,int mm,int imin){
  int i;
  int mmin=8000;
  if(gg==0)
    return mm;
  else{
    for(i=imin;i<6;i++){
      if(g[i]<=gg)
	mmin=min(f(g,m,gg-g[i],mm+m[i],i),mmin);
    }
  }
  return mmin;
}
int main(){
  int gg;
  int g[6]={1500,1200,1000,500,300,200};
  int m[6]={2244,1870,1520,850,550,380};
  for(;;){
    cin>>gg;
    if(gg==0)
      break;
    cout<<f(g,m,gg,0,0)<<endl;
  }
  return 0;
}