import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	} main {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String n = sc.next(); n sc.next() sc.next sc String firstNum = n.substring(0, 1); firstNum n.substring(0, 1) n.substring n 0 1 if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		} Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum) Integer.parseInt(n) Integer.parseInt Integer n Integer.parseInt(firstNum + firstNum + firstNum) Integer.parseInt Integer firstNum + firstNum + firstNum firstNum + firstNum + firstNum firstNum firstNum firstNum {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} int a = Integer.parseInt(firstNum) + 1; a Integer.parseInt(firstNum) + 1 Integer.parseInt(firstNum) Integer.parseInt Integer firstNum 1 System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a)) System.out.println System.out System System.out String.valueOf(a) + String.valueOf(a) + String.valueOf(a) String.valueOf(a) + String.valueOf(a) + String.valueOf(a) String.valueOf(a) String.valueOf String a String.valueOf(a) String.valueOf String a String.valueOf(a) String.valueOf String a if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		} Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum) Integer.parseInt(n) Integer.parseInt Integer n Integer.parseInt(firstNum + firstNum + firstNum) Integer.parseInt Integer firstNum + firstNum + firstNum firstNum + firstNum + firstNum firstNum firstNum firstNum {
			System.out.println(firstNum + firstNum + firstNum);
		} System.out.println(firstNum + firstNum + firstNum) System.out.println System.out System System.out firstNum + firstNum + firstNum firstNum + firstNum + firstNum firstNum firstNum firstNum String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String n = sc.next();
		String firstNum = n.substring(0, 1);

		if (Integer.parseInt(n) > Integer.parseInt(firstNum + firstNum + firstNum)) {
			int a = Integer.parseInt(firstNum) + 1;
			System.out.println(String.valueOf(a) + String.valueOf(a) + String.valueOf(a));
		} else if (Integer.parseInt(n) <= Integer.parseInt(firstNum + firstNum + firstNum)) {
			System.out.println(firstNum + firstNum + firstNum);
		}
	}
}