#include<iostream>
#include<cstdio>
using namespace std;
int main( ){
  while(1){
    int n,sum=0,a,b,c,sa=0,min,a1=0,a2=0,a3=0;
  cin>>n;
  if(n==0)break;
  if(n>=1000){
    for(int i=0;i<=5;i++){
      for(int j=0;j<=5;j++){
        for(int q=0;q<=5;q++){
          sa=n-i*1500-j*1200-q*1000;
          if(i==0&&j==0&&q==0)min=sa;
          if(sa>=0&&sa!=100&&sa<=min){
            min=sa;
            a1=i;
          a2=j;
          a3=q;
          }
        }
      }
    }
  }
  sum+=850*3*a1*0.88;
  sum+=550*4*a2*0.85;
  sum+=380*5*a3*0.8;
  n-=1500*a1;
  n-=1200*a2;
  n-=1000*a3;
  a=n/500;
  if(n%500==100)a--;
  sum+=850*a;
  n-=a*500;
  c=n/300;
  if(n%300==100)c--;
  sum+=550*c;
  n-=c*300;
  b=n/200;
  if(n%200==100)b--;
  sum+=380*b;
  cout<<sum<<endl;
  }
  return 0;
}