import java.io.*;
import java.util.*;
class Program{
    int solve(int i, int size){
        int temp = i;
        for(int j=1;j<size;j++){
            temp=temp*10+i;
        }
        return temp;
    }
}
class Main{
    public static void main(String[] args) {
        Program obj = new Program();
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java class Program{
    int solve(int i, int size){
        int temp = i;
        for(int j=1;j<size;j++){
            temp=temp*10+i;
        }
        return temp;
    }
} Program int solve(int i, int size){
        int temp = i;
        for(int j=1;j<size;j++){
            temp=temp*10+i;
        }
        return temp;
    } solve {
        int temp = i;
        for(int j=1;j<size;j++){
            temp=temp*10+i;
        }
        return temp;
    } int temp = i; temp i for(int j=1;j<size;j++){
            temp=temp*10+i;
        } int j=1; int j=1; j 1 j<size j size j++ j++ j {
            temp=temp*10+i;
        } {
            temp=temp*10+i;
        } temp=temp*10+i temp temp*10+i temp*10 temp 10 i return temp; temp int i i int size size class Main{
    public static void main(String[] args) {
        Program obj = new Program();
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        }
    }
} Main public static void main(String[] args) {
        Program obj = new Program();
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        }
    } main {
        Program obj = new Program();
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        }
    } Program obj = new Program(); obj new Program() Scanner in = new Scanner(System.in); in new Scanner(System.in) int N = in.nextInt(); N in.nextInt() in.nextInt in for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        } int i=1; int i=1; i 1 i<=9 i 9 i++ i++ i {
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        } {
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        } if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;} obj.solve(i,String.valueOf(N).length())>=N obj.solve(i,String.valueOf(N).length()) obj.solve obj i String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N N {System.out.println(obj.solve(i,String.valueOf(N).length())); break;} System.out.println(obj.solve(i,String.valueOf(N).length())) System.out.println System.out System System.out obj.solve(i,String.valueOf(N).length()) obj.solve obj i String.valueOf(N).length() String.valueOf(N).length String.valueOf(N) String.valueOf String N break; String[] args args
import java.io.*;
import java.util.*;
class Program{
    int solve(int i, int size){
        int temp = i;
        for(int j=1;j<size;j++){
            temp=temp*10+i;
        }
        return temp;
    }
}
class Main{
    public static void main(String[] args) {
        Program obj = new Program();
        Scanner in = new Scanner(System.in);
        int N = in.nextInt();
        for(int i=1;i<=9;i++){
            if(obj.solve(i,String.valueOf(N).length())>=N) {System.out.println(obj.solve(i,String.valueOf(N).length())); break;}
            //System.out.println(obj.solve(i,String.valueOf(N).length()));
        }
    }
}