import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc sc.close() sc.close sc for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        } int i = n; int i = n; i n i < 1000 i 1000 i++ i++ i {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        } {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        } int tmp = i; tmp i int a = tmp % 10; a tmp % 10 tmp 10 tmp /= 10 tmp 10 int b = tmp % 10; b tmp % 10 tmp 10 tmp /= 10 tmp 10 int c = tmp % 10; c tmp % 10 tmp 10 if (a == b && b == c) {
                System.out.println(i);
                return;
            } a == b && b == c a == b a b b == c b c {
                System.out.println(i);
                return;
            } System.out.println(i) System.out.println System.out System System.out i return; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        sc.close();

        for (int i = n; i < 1000; i++) {
            int tmp = i;
            int a = tmp % 10;
            tmp /= 10;
            int b = tmp % 10;
            tmp /= 10;
            int c = tmp % 10;

            if (a == b && b == c) {
                System.out.println(i);
                return;
            }
        }
    }
}