#include <algorithm>
#include <cstdio>
#include <utility>

using namespace std;

int find_answer(int quantity, int curr) {
  pair<int, int> prices[] = {
    make_pair(1500, 2244),
    make_pair(1200, 1870),
    make_pair(1000, 1520),
    make_pair(500, 850),
    make_pair(300, 550),
    make_pair(200, 380)
  };
  auto price = prices[curr];
  int div = quantity / price.first;
  int mod = quantity % price.first;
  if (mod == 0) { return price.second * div; }
  if (curr == 5 && mod == 100) { return 999999; }

  int best = 999999;
  for (int i = 0; i <= div; ++i) {
    int answer = price.second * i +
        find_answer(quantity - (price.first * i), curr + 1);
    best = min(best, answer);
  }
  return best;
}

int main() {
  while (true) {
    int quantity;
    scanf("%d", &quantity);
    if (quantity == 0) { break; }
    printf("%d\n", find_answer(quantity, 0));
  }
  return 0;
}