import java.util.Scanner;

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

        int times = ((N - 1) / 111) + 1;
        System.out.print(times);
        System.out.print(times);
        System.out.println(times);
    }
} import java.util.Scanner; Scanner java.util class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();

        int times = ((N - 1) / 111) + 1;
        System.out.print(times);
        System.out.print(times);
        System.out.println(times);
    }
} Main public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();

        int times = ((N - 1) / 111) + 1;
        System.out.print(times);
        System.out.print(times);
        System.out.println(times);
    } main {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();

        int times = ((N - 1) / 111) + 1;
        System.out.print(times);
        System.out.print(times);
        System.out.println(times);
    } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int N = scanner.nextInt(); N scanner.nextInt() scanner.nextInt scanner int times = ((N - 1) / 111) + 1; times ((N - 1) / 111) + 1 ((N - 1) / 111) (N - 1) N 1 111 1 System.out.print(times) System.out.print System.out System System.out times System.out.print(times) System.out.print System.out System System.out times System.out.println(times) System.out.println System.out System System.out times String[] args args
import java.util.Scanner;

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

        int times = ((N - 1) / 111) + 1;
        System.out.print(times);
        System.out.print(times);
        System.out.println(times);
    }
}
