import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		} main {
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int[] l = {111,222,333,444,555,666,777,888,999}; l {111,222,333,444,555,666,777,888,999} 111 222 333 444 555 666 777 888 999 int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        } int i l {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        } {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        } if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    } b <= i b i {
    			System.out.println(i);
	    		break;
        	    } System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 参加できるリスト
		int[] l = {111,222,333,444,555,666,777,888,999};
		// 整数の入力
        	int b = sc.nextInt();
	        for ( int i : l ) {
        	    if ( b <= i ) {
    			System.out.println(i);
	    		break;
        	    }
	        }
		}
}