#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 main(void){
  int n;
  int dp[5001]={0};
  FOR(i,1,5001) dp[i] = 1e8;
  REP(i,6){
    FOR(j,0,5001-d[i]){
      dp[j+d[i]] = min(dp[j] + m[i], dp[j+d[i]]);
    }
  }
  while(cin>>n){
    if(!n) break;
    cout<<dp[n]<<endl;
  }
  return 0;
}