import java.util.Scanner;

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

		while (N < 1000) {
			if (N / 100 == ((N / 10) % 10) && N / 100 == N % 10) {
				System.out.println(N);
				break;
			}
			N += 1;
		}
	}
} 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();

		while (N < 1000) {
			if (N / 100 == ((N / 10) % 10) && N / 100 == N % 10) {
				System.out.println(N);
				break;
			}
			N += 1;
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

		while (N < 1000) {
			if (N / 100 == ((N / 10) % 10) && N / 100 == N % 10) {
				System.out.println(N);
				break;
			}
			N += 1;
		}
	} main {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();

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

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

		while (N < 1000) {
			if (N / 100 == ((N / 10) % 10) && N / 100 == N % 10) {
				System.out.println(N);
				break;
			}
			N += 1;
		}
	}
} Main
import java.util.Scanner;

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

		while (N < 1000) {
			if (N / 100 == ((N / 10) % 10) && N / 100 == N % 10) {
				System.out.println(N);
				break;
			}
			N += 1;
		}
	}
}