import java.util.Scanner;

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

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	}
} 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 answer = -1;

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int answer = -1;

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int answer = -1;

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc int answer = -1; answer -1 1 for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		} int i = 1; int i = 1; i 1 i <= 9 i 9 i++ i++ i {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		} {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		} if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			} N <= i * 1 + i * 10 + i * 100 N i * 1 + i * 10 + i * 100 i * 1 + i * 10 + i * 100 i * 1 i 1 i * 10 i 10 i * 100 i 100 {
				answer = i * 1 + i * 10 + i * 100;
				break;
			} answer = i * 1 + i * 10 + i * 100 answer i * 1 + i * 10 + i * 100 i * 1 + i * 10 + i * 100 i * 1 i 1 i * 10 i 10 i * 100 i 100 break; System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int answer = -1;

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

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

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	}
} 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 answer = -1;

		for (int i = 1; i <= 9; i++) {
			if (N <= i * 1 + i * 10 + i * 100) {
				answer = i * 1 + i * 10 + i * 100;
				break;
			}
		}

		System.out.println(answer);
	}
}
