#include<iostream>
#include<algorithm>

using namespace std;

int main()
{
  int n;
  for(;cin>>n,n;)
    {
      int ans;

      int tmp=n,sum=0;
      //A
      for(;tmp>0;)
	{
	  if(tmp>799)
	    {
	      tmp-=1000;
	      sum+=380*5*0.8;
	    }
	  else
	    {
	      tmp-=200;
	      sum+=380;
	    }	    
	}
      ans=sum;
      tmp=n;
      sum=0;
      //B
      for(;tmp>0;)
	{
	  if(tmp>1199)
	    {
	      tmp-=1200;
	      sum+=550*4*0.85;
	    }
	  else
	    {
	      tmp-=300;
	      sum+=550;
	    }	    
	}
      ans=min(ans,sum);
      tmp=n;
      sum=0;

      //C
      for(;tmp>0;)
	{
	  if(tmp>1499)
	    {
	      tmp-=1500;
	      sum+=850*3*0.88;
	    }
	  else
	    {
	      tmp-=500;
	      sum+=850;
	    }	    
	}
      ans=min(ans,sum);
      tmp=n;
      sum=0;

      cout<<ans<<endl;
    }
}