import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    }
} import java.util.*; util.* java import java.io.*; io.* java import java.lang.*; lang.* java public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    } main {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String s = sc.next(); s sc.next() sc.next sc char c = s.charAt(0); c s.charAt(0) s.charAt s 0 String a = ""; a "" String b = ""; b "" for (int i = 0; i<s.length(); i++){
            a += c;
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            a += c;
        } {
            a += c;
        } a += c a c for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        } int i = 0; int i = 0; i 0 i<s.length() i s.length() s.length s i++ i++ i {
            b += Integer.parseInt(String.valueOf(c))+1;
        } {
            b += Integer.parseInt(String.valueOf(c))+1;
        } b += Integer.parseInt(String.valueOf(c))+1 b Integer.parseInt(String.valueOf(c))+1 Integer.parseInt(String.valueOf(c)) Integer.parseInt Integer String.valueOf(c) String.valueOf String c 1 if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b); Integer.parseInt(a) >= Integer.parseInt(s) Integer.parseInt(a) Integer.parseInt Integer a Integer.parseInt(s) Integer.parseInt Integer s System.out.println(a) System.out.println System.out System System.out a System.out.println(b) System.out.println System.out System System.out b String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    }
} Main
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        char c = s.charAt(0);
        String a = "";
        String b = "";
        for (int i = 0; i<s.length(); i++){
            a += c;
        }
        for (int i = 0; i<s.length(); i++){
            b += Integer.parseInt(String.valueOf(c))+1;
        }
        if (Integer.parseInt(a) >= Integer.parseInt(s))
            System.out.println(a);
        else
            System.out.println(b);
    }
}