import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    }    
} import java.util.*; util.* java public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    }    
} Main public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int co = 0; co 0 while(co < n){
            co += 111;
        } co < n co n {
            co += 111;
        } co += 111 co 111 System.out.println(co) System.out.println System.out System System.out co String[] args args public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    }    
} public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    }    
} Main
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int co = 0;
        while(co < n){
            co += 111;
        }
        System.out.println(co);
    }    
}
