import java.util.*;
class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		int n = scan.nextInt();
		int n1 = n%10;
		int n2 = (n%100 - n1)/10;
		int n3 = (n - n1 -n1)/100;
		if(n3==9){n = 999; System.out.println(n);return;}
		if(n1>n3 || n2>n3){
			n3 += 1;
		}
		n = n3*100 + n3*10 + n3;
		System.out.println(n);
	}
} import java.util.*; util.* java class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		int n = scan.nextInt();
		int n1 = n%10;
		int n2 = (n%100 - n1)/10;
		int n3 = (n - n1 -n1)/100;
		if(n3==9){n = 999; System.out.println(n);return;}
		if(n1>n3 || n2>n3){
			n3 += 1;
		}
		n = n3*100 + n3*10 + n3;
		System.out.println(n);
	}
} Main static Scanner scan = new Scanner(System.in); scan new Scanner(System.in) public static void main(String[] argv){
		int n = scan.nextInt();
		int n1 = n%10;
		int n2 = (n%100 - n1)/10;
		int n3 = (n - n1 -n1)/100;
		if(n3==9){n = 999; System.out.println(n);return;}
		if(n1>n3 || n2>n3){
			n3 += 1;
		}
		n = n3*100 + n3*10 + n3;
		System.out.println(n);
	} main {
		int n = scan.nextInt();
		int n1 = n%10;
		int n2 = (n%100 - n1)/10;
		int n3 = (n - n1 -n1)/100;
		if(n3==9){n = 999; System.out.println(n);return;}
		if(n1>n3 || n2>n3){
			n3 += 1;
		}
		n = n3*100 + n3*10 + n3;
		System.out.println(n);
	} int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan int n1 = n%10; n1 n%10 n 10 int n2 = (n%100 - n1)/10; n2 (n%100 - n1)/10 (n%100 - n1) n%100 n 100 n1 10 int n3 = (n - n1 -n1)/100; n3 (n - n1 -n1)/100 (n - n1 -n1) n - n1 -n1 n n1 n1 100 if(n3==9){n = 999; System.out.println(n);return;} n3==9 n3 9 {n = 999; System.out.println(n);return;} n = 999 n 999 System.out.println(n) System.out.println System.out System System.out n return; if(n1>n3 || n2>n3){
			n3 += 1;
		} n1>n3 || n2>n3 n1>n3 n1 n3 n2>n3 n2 n3 {
			n3 += 1;
		} n3 += 1 n3 1 n = n3*100 + n3*10 + n3 n n3*100 + n3*10 + n3 n3*100 + n3*10 + n3 n3*100 n3 100 n3*10 n3 10 n3 System.out.println(n) System.out.println System.out System System.out n String[] argv argv
import java.util.*;
class Main{
	static Scanner scan = new Scanner(System.in);
	public static void main(String[] argv){
		int n = scan.nextInt();
		int n1 = n%10;
		int n2 = (n%100 - n1)/10;
		int n3 = (n - n1 -n1)/100;
		if(n3==9){n = 999; System.out.println(n);return;}
		if(n1>n3 || n2>n3){
			n3 += 1;
		}
		n = n3*100 + n3*10 + n3;
		System.out.println(n);
	}
}