import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    }
} 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 n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    } main {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int n = N / 100; n N / 100 N 100 int x = Integer.parseInt(n + "" + n + "" + n); x Integer.parseInt(n + "" + n + "" + n) Integer.parseInt Integer n + "" + n + "" + n "" n n + "" + n + "" + n n "" n "" n if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        } x < N x N {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } n = n + 1 n n + 1 n 1 x = Integer.parseInt(n + "" + n + "" + n) x Integer.parseInt(n + "" + n + "" + n) Integer.parseInt Integer n + "" + n + "" + n "" n n + "" + n + "" + n n "" n "" n System.out.println(x) System.out.println System.out System System.out x {
            System.out.println(x);
        } System.out.println(x) System.out.println System.out System System.out x String[] args args public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    }
} 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 n = N / 100;
        int x = Integer.parseInt(n + "" + n + "" + n);

        if (x < N) {
            n = n + 1;
            x = Integer.parseInt(n + "" + n + "" + n);
            System.out.println(x);
        } else {
            System.out.println(x);
        }
    }
}