import java.util.*;

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

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    }
} import java.util.*; util.* java public class Main {
	public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    }
} Main public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    } main {

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int num = sc.nextInt(); num sc.nextInt() sc.nextInt sc int a = num / 100; a num / 100 num 100 int b = (num - a*100) / 10; b (num - a*100) / 10 (num - a*100) num a*100 a 100 10 int c = (num - a*100 - b*10); c (num - a*100 - b*10) num - a*100 - b*10 num a*100 a 100 b*10 b 10 if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        } a < b a b {
            a++;
        } a++ a if(a == b){
             if(b < c){
                 a++;
             }
        } a == b a b {
             if(b < c){
                 a++;
             }
        } if(b < c){
                 a++;
             } b < c b c {
                 a++;
             } a++ a System.out.println(a*100 + a*10 + a) System.out.println System.out System System.out a*100 + a*10 + a a*100 + a*10 + a a*100 a 100 a*10 a 10 a String[] args args public class Main {
	public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    }
} public class Main {
	public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    }
} Main
import java.util.*;

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

        Scanner sc = new Scanner(System.in);
		int num = sc.nextInt();
		int a = num / 100;
		int b = (num - a*100) / 10;
		int c = (num - a*100 - b*10);

        if(a < b){
            a++;
        }else if(a == b){
             if(b < c){
                 a++;
             }
        }
        
        System.out.println(a*100 + a*10 + a);
    }
}
