#include <stdio.h>
#include <limits.h>

int main(void)
{
	int i;
	int soba;
	int mp;
	int p;
	int n;
	
	while (scanf("%d", &soba), soba != 0){
		mp = INT_MAX;
		if (soba % 200 > 0){
			n = soba / 200 + 1;
		}
		else {
			n = soba / 200;
		}
		p = (380 * (n / 5 * 5)) * 0.8 + 380 * (n - n / 5 * 5);
		
		if (p < mp) mp = p;
		
		if (soba % 300 > 0){
			n = soba / 300 + 1;
		}
		else {
			n = soba / 300;
		}
		p = (550 * (n / 4 * 4)) * 0.85 + 550 * (n - n / 4 * 4);
		if (p < mp) mp = p;
		
		if (soba % 500 > 0){
			n = soba / 500 + 1;
		}
		else {
			n = soba / 500;
		}
		p = (850 * (n / 3 * 3)) * 0.88 + 850 * (n - n / 3 * 3);
		if (p < mp) mp = p;
		
		printf("%d\n", mp);
	}
	return (0);
}