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

int solve(int n){
  int res = INF;
  if(!n) return 0;
  if(n < 0) return INF;
  return 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;
  while(cin >> n, n) cout << solve(n) << endl; 
}