#include <iostream>

using namespace std;

int main(){
  constexpr int n=3;
  int weight[n]={200,300,500};
  int price[n]={380,550,850};
  int discountnum[n]={5,4,3};
  double discount[n]={0.8,0.85,0.88};
  int w;
  while(cin>>w,w){
    int minprice=0x7fffffff;
    for(int i=0;i<n;i++){
      if(w%weight[i])continue;
      int num=w/weight[i];
      int p=double(price[i]*(num-num%discountnum[i]))*discount[i]
        +price[i]*(num%discountnum[i]);
      if(minprice>p)minprice=p;
    }
    cout<<minprice<<endl;
  }
}