#include <iostream>
#include <string>
using namespace std;

int main()
{
	/*1500g = 2244
	  1200g = 1870
	  1000g = 1520
	  500g  = 850
	  300g  = 550
	  200g  = 380  */

	int g , n;
	int p = 0;

	while (cin >> g)
	{
		if (g == 0) break;

		if (g/1500 >= 0)
		{
			n = g / 1500;
			p += 2244 * n;
			g -= 1500 * n;
		}

		else if (g / 1200 >= 0)
		{
			n = g / 1200;
			p += 1870 * n;
			g -= 1200 * n;
		}

		else if (g / 1000 >= 0)
		{
			n = g / 1000;
			p += 1520 * n;
			g -= 1000 * n;
		}

		else if (g / 500 >= 0)
		{
			n = g / 500;
			p += 850 * n;
			g -= 500 * n;
		}

		else if (g / 300 >= 0)
		{
			n = g / 300;
			p += 550 * n;
			g -= 300 * n;
		}

		else if (g / 200 >= 0)
		{
			n = g / 200;
			p += 380 * n;
			g -= 200 * n;
		}

		cout << p << endl;
	}

	return 0;
}