import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	}

} import java.util.ArrayList; ArrayList java.util import java.util.Arrays; Arrays java.util import java.util.HashMap; HashMap java.util import java.util.HashSet; HashSet java.util import java.util.List; List java.util import java.util.Map; Map java.util import java.util.Scanner; Scanner java.util import java.util.Set; Set java.util public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	}

} Main public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	} main {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int n = Integer.parseInt(scanner.nextLine()); n Integer.parseInt(scanner.nextLine()) Integer.parseInt Integer scanner.nextLine() scanner.nextLine scanner int a = Integer.parseInt(String.valueOf(n).substring(0,1)); a Integer.parseInt(String.valueOf(n).substring(0,1)) Integer.parseInt Integer String.valueOf(n).substring(0,1) String.valueOf(n).substring String.valueOf(n) String.valueOf String n 0 1 int atama = 0; atama 0 for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {

			atama += a * (int)Math.pow(10, i);
		} {

			atama += a * (int)Math.pow(10, i);
		} atama += a * (int)Math.pow(10, i) atama a * (int)Math.pow(10, i) a (int)Math.pow(10, i) Math.pow Math 10 i boolean flg = true; flg true if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		} atama < n atama n {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		} a++ a atama = 0 atama 0 for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {

				atama += a * (int)Math.pow(10, i);
			} {

				atama += a * (int)Math.pow(10, i);
			} atama += a * (int)Math.pow(10, i) atama a * (int)Math.pow(10, i) a (int)Math.pow(10, i) Math.pow Math 10 i System.out.println(atama) System.out.println System.out System System.out atama String[] args args public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	}

} public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	}

} Main
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.Set;

public class Main{

	public static void main(String[] args) {

		Scanner scanner = new Scanner(System.in);

		int n = Integer.parseInt(scanner.nextLine());
		int a = Integer.parseInt(String.valueOf(n).substring(0,1));
		int atama = 0;
		for(int i = 0; i < 3; i++) {

			atama += a * (int)Math.pow(10, i);
		}

		boolean flg = true;

		if(atama < n) {

			a++;
			atama = 0;
			for(int i = 0; i < 3; i++) {

				atama += a * (int)Math.pow(10, i);
			}

		}

		System.out.println(atama);
	}

}