import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    }
} import java.io.IOException; IOException java.io import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    }
} Main public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    } main {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    } final String s; s try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        } {
            s = reader.readLine();
        } BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in)) new BufferedReader(
                new InputStreamReader(System.in)) s = reader.readLine() s reader.readLine() reader.readLine reader int N = Integer.parseInt(s); N Integer.parseInt(s) Integer.parseInt Integer s for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        } int i = N; int i = N; i N i < 1000 i 1000 i++ i++ i {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        } {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            } str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2) str.charAt(0) == str.charAt(1) str.charAt(0) str.charAt str 0 str.charAt(1) str.charAt str 1 str.charAt(1) == str.charAt(2) str.charAt(1) str.charAt str 1 str.charAt(2) str.charAt str 2 {
                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) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    }
} public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    }
} Main
import java.io.IOException;

import java.io.BufferedReader;
import java.io.InputStreamReader;

@SuppressWarnings("unchecked")
public class Main {
    public static void main(String[] args) throws IOException {
        final String s;

        try (
            BufferedReader reader = new BufferedReader(
                new InputStreamReader(System.in))) {
            s = reader.readLine();
        }

        int N = Integer.parseInt(s);

        for (int i = N; i < 1000; i++) {
            String str = String.valueOf(i);
            if (str.charAt(0) == str.charAt(1)
                && str.charAt(1) == str.charAt(2)) {
                System.out.println(i);
                break;
            }
        }
    }
}
