#include<iostream>
#include<cmath>
#include<math.h>
#include<string>
#include <fstream>
#include <cctype>
#include <iomanip>
#include <algorithm>
using namespace std;
int main()
{
	freopen("DATA1.txt","r",stdin);
	freopen("OUT1.txt","w",stdout);
	int x,y,z;
	for(y=0;y<5;y++)
	{
		int n;
		cin >> n;
		x=0;
		while(1)
		{
			if((x*0.99*0.7)>=n)
			{
				cout << x << endl;
				break;
			}
			x+=1000;
		}
	}
	return(0);
}
