#include <iostream>
#include <climits>

void init_nums(int nums[])
{
	nums[0] = nums[1] = nums[2] = 0;
}

int cost(int nums[])
{
	int A = nums[0];
	int B = nums[1];
	int C = nums[2];
	
	int qA = A / 5;
	int rA = A % 5;
	int qB = B / 4;
	int rB = B % 4;
	int qC = C / 3;
	int rC = C % 3;
	
	return 1520 * qA + 380 * rA + 1870 * qB + 550 * rB + 2244 * qC + 850 * rC;
}

int minCost(int a, int nums[])
{
	if (a==0) return cost(nums);
	
	int res = INT_MAX;
	
	if (a>=500) {
		nums[2]++; 
		res = std::min(res, minCost(a-500, nums));
		nums[2]--;
	}
	if (a>=300) {
		nums[1]++;
		res = std::min(res, minCost(a-300, nums));
		nums[1]--;
	}
	if (a>=200) {
		nums[0]++;
		res = std::min(res, minCost(a-200, nums));
		nums[0]--;
	}
	
	return res;
}

int main()
{
	int a;
	int nums[3];
	while (true) {
		std::cin >> a;
		if (a == 0) break;
		init_nums(nums);
		std::cout << minCost(a, nums) << std::endl;
	}
	return 0;
}


