//============================================================================
// Name        : blah.cpp
// Author      : Marko Zhen
// Version     :
// Copyright   : (c) 2009 Marko Zhen
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <fstream>
#include <math.h>
#include <string>
using namespace std;

int main() {
	double pages;
	int i = 0;
	int output = 0;
	double answer =0;
	ofstream outPut;
	ifstream myFile("DATA1.txt");
	outPut.open("OUT1.txt");
	for (i=0; i<5; i++){
		myFile >> pages;
		output = pages/0.7/0.99;
		if (output%1000!=0){
			answer = output+1000-(output%1000);
			outPut << answer << endl;
		}

		output = 0;
	}

	return 0;
}

