/**
 * @(#)DwiteOne.java
 *
 *
 * @author 
 * @version 1.00 2009/10/21
 */
import java.io.*;
public class DwiteOne {
        
    /**
     * Creates a new instance of <code>DwiteOne</code>.
     */
    public DwiteOne() {
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        int profit=699;
        double total;
        int amount;
        BufferedReader in = null;
		PrintWriter out = null;
		
		try{
			in= new BufferedReader(new InputStreamReader(new FileInputStream("DATA1.txt")));
			 out= new PrintWriter(new BufferedWriter(new FileWriter("OUT1.txt")));
		}catch(Exception e){}
		for(int i=0; i<5; i++){
			try{
				profit = Integer.parseInt(in.readLine());
			}catch(Exception e){}
	        total = profit + profit/70*30;
	        
	        
	        amount = (int)Math.ceil(total/0.99);
	        
	        //amount = amount/1000;
	        //System.out.println((int)Math.ceil(((double)amount/1000)));
	        amount = (int)Math.ceil(((double)amount/1000));
	        amount = amount*1000;
	        try{
		        out.println(amount);
	        }catch(Exception e){}
		}
		out.close();
    }
}

