#include <stdio.h>
#include <iostream>
#include <stdlib.h>
#include <vector>

using namespace std;

int s=99999999;

void kakerukamosirenai(int total,int left,int a,int b,int c,int f){
	if(left>0){
		if(f==0){
			kakerukamosirenai(total+380,left-200,a+200,b,c,0);//a toru
			kakerukamosirenai(total,left,a,b,c,1);//a toranai
		}else if(f==1){
			kakerukamosirenai(total+550,left-300,a,b+300,c,1);//b toru
			kakerukamosirenai(total,left,a,b,c,2);//b toranai
		}else if(f==2){
			kakerukamosirenai(total+850,left-500,a,b,c+500,2);//c
		}
	}else if(left==0){
		int cnt=0;
		while(a>=1000){
			a-=1000;
//			total -= 380;
			cnt++;
		}
		total-=(1900*cnt)*20/100;
		cnt=0;

		while(b>=1200){
			b-=1200;
//			total -= 330;
			cnt++;
		}
		total-=(2200*cnt)*15/100;
		cnt=0;

		while(c>=1500){
			c-=1500;
//			total -= 306;
			cnt++;
		}
		total-=(2550*cnt)*12/100;

		if(s>total){
			s = total;
		}
	}else{
//		cout << "erratta" <<endl;
	}
}

int main(){

	vector<int> p;
	int n,c=0,a,t;

	while(1){
		cin >> n;
		p.push_back(n);
		if(p[c]==0)break;
		c++;
	}

	for(int i=0;i<c;i++){
		kakerukamosirenai(0,p[i],0,0,0,0);
		cout << s << endl;
		s = 999999999;
	}

	return 0;
}