import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    }
} 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();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    } main {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int n = sc.nextInt(); n sc.nextInt() sc.nextInt sc int n100; n100 int n10; n10 int n1; n1 for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        } int i = n; int i = n; i n i < 1000 i 1000 i++ i++ i {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        } {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        } n100 = i / 100 n100 i / 100 i 100 n10 = (i / 10) % 10 n10 (i / 10) % 10 (i / 10) i 10 10 n1 = i % 10 n1 i % 10 i 10 if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            } n100 == n10 && n10 == n1 n100 == n10 n100 n10 n10 == n1 n10 n1 {
                System.out.println(i);
                break;
            } System.out.println(i) System.out.println System.out System System.out i break; String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int n100;
        int n10;
        int n1;
        for (int i = n; i < 1000; i++) {
            n100 = i / 100;
            n10 = (i / 10) % 10;
            n1 = i % 10;
            if (n100 == n10 && n10 == n1) {
                System.out.println(i);
                break;
            }
        }

    }
}