#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
static const double EPS = 1e-5;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
int d[6] = {1500,1200,1000,500,300,200};
int m[6] = {2244,1870,1520,850,550,380};
int s(int i,int n){
  if(i==5){
    if(n%200) return 1e8;
    else return n/d[i]*m[i];
  }
  return min( n/d[i]*m[i]+s(i+1,n%d[i]), s(i+1,n));
}
int main(void){
  int n;
  while(cin>>n){
    if(!n) break;
    cout<<s(0,n)<<endl;
  }
  return 0;
}