import java.util.Scanner;

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

        for (int n = N; n <= 999; n++) {
            int a = n / 100;
            int b = (n / 10) % 10;
            int c = n % 10;
            if (a == b && b == c) {
                System.out.println(n);
                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();

        for (int n = N; n <= 999; n++) {
            int a = n / 100;
            int b = (n / 10) % 10;
            int c = n % 10;
            if (a == b && b == c) {
                System.out.println(n);
                return;
            }
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        for (int n = N; n <= 999; n++) {
            int a = n / 100;
            int b = (n / 10) % 10;
            int c = n % 10;
            if (a == b && b == c) {
                System.out.println(n);
                return;
            }
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

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

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

        for (int n = N; n <= 999; n++) {
            int a = n / 100;
            int b = (n / 10) % 10;
            int c = n % 10;
            if (a == b && b == c) {
                System.out.println(n);
                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();

        for (int n = N; n <= 999; n++) {
            int a = n / 100;
            int b = (n / 10) % 10;
            int c = n % 10;
            if (a == b && b == c) {
                System.out.println(n);
                return;
            }
        }
    }
}
