import java.util.*;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    }
} import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int time = sc.nextInt(); time sc.nextInt() sc.nextInt sc String n = Integer.toString(time); n Integer.toString(time) Integer.toString Integer time String str[] = n.split(""); str n.split("") n.split n "" String s = str[0]; s str[0] str 0 for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        } int i=1; int i=1; i 1 i<str.length i str.length str str.length i++ i++ i {
            str[i] = str[0];
            s += str[i];
        } {
            str[i] = str[0];
            s += str[i];
        } str[i] = str[0] str[i] str i str[0] str 0 s += str[i] s str[i] str i int x = Integer.parseInt(s); x Integer.parseInt(s) Integer.parseInt Integer s if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        } x >= time x time System.out.println(x) System.out.println System.out System System.out x {
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        } int a = Integer.parseInt(str[0]) +1; a Integer.parseInt(str[0]) +1 Integer.parseInt(str[0]) Integer.parseInt Integer str[0] str 0 1 for(int i=0; i<str.length; i++){
                System.out.print(a);
            } int i=0; int i=0; i 0 i<str.length i str.length str str.length i++ i++ i {
                System.out.print(a);
            } {
                System.out.print(a);
            } System.out.print(a) System.out.print System.out System System.out a String[] args args public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    }
} Main
import java.util.*;
 
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int time = sc.nextInt();
        String n = Integer.toString(time);
        String str[] = n.split("");
        String s = str[0];
        for(int i=1; i<str.length; i++){
            str[i] = str[0];
            s += str[i];
        }
        int x = Integer.parseInt(s);
        if(x >= time) System.out.println(x);
        else{
            int a = Integer.parseInt(str[0]) +1;
            for(int i=0; i<str.length; i++){
                System.out.print(a);
            }
        }
    }
}