import java.io.*;
import hsa.Console;

// The "Rhombus" class.
public class iProfit
{
    public static void main (String[] args) throws IOException
    {

	// Open up the input and output file for IO purpose
	FileReader inFile = new FileReader ("DATA1.txt");
	FileWriter outFile = new FileWriter ("OUT1.txt");

	// Link the input and output file for
	BufferedReader in = new BufferedReader (inFile);
	BufferedWriter out = new BufferedWriter (outFile);

	// String e;
	String line;

	// Keep reading as long as not end of file (eof)
	while ((line = in.readLine ()) != null)
	{
	    int num = Integer.parseInt (line);
	    double totalSold = num / 0.7;
	    long totalSold2 = Math.round (totalSold);
	    double profit = totalSold2 / 0.99;
	    boolean done = false;
	    int count = 0;
	    while (done == false)
	    {
		if (profit > count)
		{
		    count = count + 1000;
		}
		else if (profit <= count)
		{

		    String temp = "" + count;
		    out.write (temp);
		    out.newLine ();
		    done = true;
		}
	    }

	}

	out.flush ();
	out.close ();
    }




}







// main method
// End of Class



