
import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    }

} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    }

} Main public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        } int i = n; int i = n; i n i <= 999 i 999 i++ i++ i {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        } {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        } String k = String.valueOf(i); k String.valueOf(i) String.valueOf String i if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            } k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2) k.charAt(0) == k.charAt(1) k.charAt(0) k.charAt k 0 k.charAt(1) k.charAt k 1 k.charAt(1) == k.charAt(2) k.charAt(1) k.charAt k 1 k.charAt(2) k.charAt k 2 {
                System.out.println(k);
                break;
            } System.out.println(k) System.out.println System.out System System.out k break; String args[] args public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    }

} public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    }

} Main

import java.util.*;

public class Main {

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for (int i = n; i <= 999; i++) {
            String k = String.valueOf(i);
            if (k.charAt(0) == k.charAt(1) && k.charAt(1) == k.charAt(2)) {
                System.out.println(k);
                break;
            }
        }

    }

}
