import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	}
} 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();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	} main {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int N = sc.nextInt(); N sc.nextInt() sc.nextInt sc for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		} int i = N; int i = N; i N i < 1000 i 1000 i++ i++ i {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		} {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			} s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2) s.charAt(0) == s.charAt(1) s.charAt(0) s.charAt s 0 s.charAt(1) s.charAt s 1 s.charAt(0) == s.charAt(2) s.charAt(0) s.charAt s 0 s.charAt(2) s.charAt s 2 {
				System.out.println(s);
				return;
			} System.out.println(s) System.out.println System.out System System.out s return; String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	}
} Main
import java.util.Scanner;
 
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int N = sc.nextInt();
		
		for (int i = N; i < 1000; i++) {
			String s = String.valueOf(i);
			if (s.charAt(0) == s.charAt(1) && s.charAt(0) == s.charAt(2)) {
				System.out.println(s);
				return;
			}
		}
	}
}
