import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
} import java.util.*; util.* java public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
} Main public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		} int k=1; int k=1; k 1 k<=9 k 9 k++ k++ k {
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		} {
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		} if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			} k+10*k+100*k >= n k+10*k+100*k k+10*k+100*k k 10*k 10 k 100*k 100 k n {
				System.out.println(k+10*k+100*k);
				break;
			} System.out.println(k+10*k+100*k) System.out.println System.out System System.out k+10*k+100*k k+10*k+100*k k 10*k 10 k 100*k 100 k break; String args[] args public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
} public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
} Main
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		for(int k=1;k<=9;k++){
			if(k+10*k+100*k >= n){
				System.out.println(k+10*k+100*k);
				break;
			}
		}
	}
}