
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();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	}
} 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();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	}
} Main public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	} main {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	} Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int n = scan.nextInt(); n scan.nextInt() scan.nextInt scan String digits = String.valueOf(n / 100); digits String.valueOf(n / 100) String.valueOf String n / 100 n 100 String s = digits + digits + digits; s digits + digits + digits digits + digits + digits digits digits digits int continuing = Integer.valueOf(s); continuing Integer.valueOf(s) Integer.valueOf Integer s if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		} continuing >= n continuing n {
			System.out.println(continuing);
		} System.out.println(continuing) System.out.println System.out System System.out continuing {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		} String digits2 = String.valueOf(n / 100 + 1); digits2 String.valueOf(n / 100 + 1) String.valueOf String n / 100 + 1 n / 100 n 100 1 String str2 = digits2 + digits2 + digits2; str2 digits2 + digits2 + digits2 digits2 + digits2 + digits2 digits2 digits2 digits2 int continuing2 = Integer.valueOf(str2); continuing2 Integer.valueOf(str2) Integer.valueOf Integer str2 System.out.println(continuing2) System.out.println System.out System System.out continuing2 String[] args args public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	}
} public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int n = scan.nextInt();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	}
} 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();
		
		//100の位を求める
		String digits = String.valueOf(n / 100);
		
		String s = digits + digits + digits;
		
		int continuing = Integer.valueOf(s);
		
		
		if (continuing >= n) {
			System.out.println(continuing);
		} else {
			String digits2 = String.valueOf(n / 100 + 1);
			
			String str2 = digits2 + digits2 + digits2;
			
			int continuing2 = Integer.valueOf(str2);
			System.out.println(continuing2);
		}
		
	}
}