
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int nnn = 0;
		int ans = 0;
		for (int i = 1; i <= 9; i++) {
			nnn = i + (i * 10) + (i* 100); 
			if(n <= nnn) {
				ans = nnn; 
				break;
			}
		}
		System.out.println(nnn);
		
	}
} import java.util.Arrays; Arrays java.util import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int nnn = 0;
		int ans = 0;
		for (int i = 1; i <= 9; i++) {
			nnn = i + (i * 10) + (i* 100); 
			if(n <= nnn) {
				ans = nnn; 
				break;
			}
		}
		System.out.println(nnn);
		
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int nnn = 0;
		int ans = 0;
		for (int i = 1; i <= 9; i++) {
			nnn = i + (i * 10) + (i* 100); 
			if(n <= nnn) {
				ans = nnn; 
				break;
			}
		}
		System.out.println(nnn);
		
	} main {

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

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

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int nnn = 0;
		int ans = 0;
		for (int i = 1; i <= 9; i++) {
			nnn = i + (i * 10) + (i* 100); 
			if(n <= nnn) {
				ans = nnn; 
				break;
			}
		}
		System.out.println(nnn);
		
	}
} Main

import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		int nnn = 0;
		int ans = 0;
		for (int i = 1; i <= 9; i++) {
			nnn = i + (i * 10) + (i* 100); 
			if(n <= nnn) {
				ans = nnn; 
				break;
			}
		}
		System.out.println(nnn);
		
	}
}