#include<iostream>
#include<algorithm>
#define INF 1<<28
using namespace std;

int memo[10000];

int solve(int n){
  int res = INF;
  if(!n) return 0;
  if(n < 0) return INF;
  if(memo[n]) return memo[n];
  return memo[n] = res = min(res, min(solve(n-1000)+1520, min(solve(n-1200)+1870, min(solve(n-1500)+2244, min(solve(n-200)+380, min(solve(n-300)+550, solve(n-500)+850))))));
}

int main(){ 
  int n;
  for(int i=0;i<5001;i++) solve(i);
  while(cin >> n, n) cout << memo[n] << endl; 
}