import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 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 = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	} main {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = Integer.parseInt(sc.next()); N Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int div = N / 111; div N / 111 N 111 for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		} int i = 0; int i = 0; i 0 i < 3 i 3 i++ i++ i {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		} {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		} if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			} N % 111 == 0 N % 111 N 111 0 {
				System.out.print(div);
			} System.out.print(div) System.out.print System.out System System.out div {
				System.out.print(div + 1);
			} System.out.print(div + 1) System.out.print System.out System System.out div + 1 div 1 String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		sc.close();

		int div = N / 111;
		for(int i = 0; i < 3; i++) {
			if(N % 111 == 0) {
				System.out.print(div);
			}else {
				System.out.print(div + 1);
			}
		}

	}
}