import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    }
    public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    }
    public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    }
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    }
    public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    }
    public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    } main {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = Integer.parseInt(sc.next()); n Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int a = n % 10; a n % 10 n 10 int b = n / 10 % 10; b n / 10 % 10 n / 10 n 10 10 int c = n / 100 % 10; c n / 100 % 10 n / 100 n 100 10 if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1)); n <= c*100+c*10+c n c*100+c*10+c c*100+c*10+c c*100 c 100 c*10 c 10 c System.out.println( c*100+c*10+c) System.out.println System.out System System.out c*100+c*10+c c*100+c*10+c c*100 c 100 c*10 c 10 c System.out.println((c+1)*100+(c+1)*10+(c+1)) System.out.println System.out System System.out (c+1)*100+(c+1)*10+(c+1) (c+1)*100+(c+1)*10+(c+1) (c+1)*100 (c+1) c 1 100 (c+1)*10 (c+1) c 1 10 (c+1) c 1 String[] args args public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    } min {
        if(a <= b) return a;
        else return b;
    } if(a <= b) return a;
        else return b; a <= b a b return a; a return b; b int a a int b b public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    } max {
        if(a <= b) return b;
        else return a;
    } if(a <= b) return b;
        else return a; a <= b a b return b; b return a; a int a a int b b public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    }
    public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    }
    public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    }
    public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    }
    public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    }
} Main
import java.util.*;
 
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        int a = n % 10;
        int b = n / 10 % 10;
        int c = n / 100 % 10;
        if(n <= c*100+c*10+c) System.out.println( c*100+c*10+c);
        else System.out.println((c+1)*100+(c+1)*10+(c+1));
        
    }
    public static int min(int a, int b) {
        if(a <= b) return a;
        else return b;
    }
    public static int max(int a, int b) {
        if(a <= b) return b;
        else return a;
    }
}