
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ns = sc.next();
        int n = Integer.parseInt(ns);
        String p = "";
        for(int i=0;i<ns.length();i++)p+=ns.charAt(0);
        if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        }

    }
} import java.util.ArrayList; ArrayList java.util import java.util.Collection; Collection java.util import java.util.Collections; Collections java.util import java.util.Comparator; Comparator java.util import java.util.Scanner; Scanner java.util class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ns = sc.next();
        int n = Integer.parseInt(ns);
        String p = "";
        for(int i=0;i<ns.length();i++)p+=ns.charAt(0);
        if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        }

    }
} Main static final int MOD = 1000000007; MOD 1000000007 public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ns = sc.next();
        int n = Integer.parseInt(ns);
        String p = "";
        for(int i=0;i<ns.length();i++)p+=ns.charAt(0);
        if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        }

    } main {
        Scanner sc = new Scanner(System.in);
        String ns = sc.next();
        int n = Integer.parseInt(ns);
        String p = "";
        for(int i=0;i<ns.length();i++)p+=ns.charAt(0);
        if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String ns = sc.next(); ns sc.next() sc.next sc int n = Integer.parseInt(ns); n Integer.parseInt(ns) Integer.parseInt Integer ns String p = ""; p "" for(int i=0;i<ns.length();i++)p+=ns.charAt(0); int i=0; int i=0; i 0 i<ns.length() i ns.length() ns.length ns i++ i++ i p+=ns.charAt(0); p+=ns.charAt(0) p ns.charAt(0) ns.charAt ns 0 if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        } n<=Integer.parseInt(p) n Integer.parseInt(p) Integer.parseInt Integer p System.out.println(p) System.out.println System.out System System.out p {
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        } p = "" p "" for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1)); int i=0; int i=0; i 0 i<ns.length() i ns.length() ns.length ns i++ i++ i p+=((char)(ns.charAt(0)+1)); p+=((char)(ns.charAt(0)+1)) p ((char)(ns.charAt(0)+1)) ns.charAt(0) ns.charAt ns 0 1 System.out.println(p) System.out.println System.out System System.out p String[] args args

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Scanner;

class Main {

    static final int MOD = 1000000007;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String ns = sc.next();
        int n = Integer.parseInt(ns);
        String p = "";
        for(int i=0;i<ns.length();i++)p+=ns.charAt(0);
        if(n<=Integer.parseInt(p))System.out.println(p);
        else{
            p = "";
            for(int i=0;i<ns.length();i++)p+=((char)(ns.charAt(0)+1));
            System.out.println(p);
        }

    }
}