#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

int main() {
  while(true) {
    int ng;
    cin >> ng;
    if(ng == 0) break;
    vector<int> resultCandidits;
    for(int c = (ng / 500); c >= 0; --c) {
      int leftc = ng - c * 500;
      for(int b = leftc / 300; b >= 0; --b) {
        int leftb = leftc - b * 300;
        if(leftb % 200 == 0 && leftb / 200 >= 0) {
          int a = leftb / 200;
          // cout << (c / 3 * 2244 + c % 3 * 850) + (b / 4 * 1870 + b % 4 * 550) + (a / 5 * 1520 + a % 5 * 380) << endl;
          resultCandidits.push_back((c / 3 * 2244 + c % 3 * 850) + (b / 4 * 1870 + b % 4 * 550) + (a / 5 * 1520 + a % 5 * 380));
          // cout << "c:" << c << ", b:" << b << ", a:" << a << endl;
        }
      }
    }
    cout << *(min_element(resultCandidits.begin(), resultCandidits.end())) << endl;
  }

  return 0;
}