#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <queue>
#include <map>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
const int dy[] = {1, 0, -1, 0};
const int dx[] = {0, 1, 0, -1};
int n, ans;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> n, n)
    {
        ans = INF;
        for(int i = 0; i < 100; i++)
        {
            for(int j = 0; j < 100; j++)
            {
                int m = n - 200 * i - 300 * j;
                if(m < 0) break;
                int k;
                if(m % 500 == 0) k = m / 500;
                else continue;
                int sum = 0;
                if(i / 5 != 0) sum += 380 * (i - i % 5) * 0.8 + 380 * (i % 5);
                else sum += 380 * i;
                if(j / 4 != 0) sum += 550 * (j - j % 4) * 0.85 + 550 * (j % 4);
                else sum += 550 * j;
                if(k / 3 != 0) sum += 850 * (k - k % 3) * 0.88 + 850 * (k % 3);
                else sum += 850 * k;
                ans = min(ans, sum);
            }
        }
        cout << ans << endl;
    }
    return 0;
}


