import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc String str = String.valueOf(a); str String.valueOf(a) String.valueOf String a int[] manieth = new int[3]; manieth new int[3] 3 int answer = 0; answer 0 for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    } int i = 0; int i = 0; i 0 i < str.length() i str.length() str.length str i++ i++ i {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    } {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    } String num = String.valueOf(str.charAt(i)); num String.valueOf(str.charAt(i)) String.valueOf String str.charAt(i) str.charAt str i manieth[i] = Integer.parseInt(num) manieth[i] manieth i Integer.parseInt(num) Integer.parseInt Integer num if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    } manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2] manieth[0] < manieth[1] manieth[0] manieth 0 manieth[1] manieth 1 manieth[0] == manieth[1] && manieth[1] < manieth[2] manieth[0] == manieth[1] manieth[0] manieth 0 manieth[1] manieth 1 manieth[1] < manieth[2] manieth[1] manieth 1 manieth[2] manieth 2 {
      answer = manieth[0] + 1;
    } answer = manieth[0] + 1 answer manieth[0] + 1 manieth[0] manieth 0 1 {
      answer = manieth[0];
    } answer = manieth[0] answer manieth[0] manieth 0 System.out.print(answer) System.out.print System.out System System.out answer System.out.print(answer) System.out.print System.out System System.out answer System.out.print(answer) System.out.print System.out System System.out answer String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
    String str = String.valueOf(a);
    int[] manieth = new int[3];
    int answer = 0;

    for (int i = 0; i < str.length(); i++) {
      String num = String.valueOf(str.charAt(i));
      manieth[i] = Integer.parseInt(num);
    }
    if (manieth[0] < manieth[1] || manieth[0] == manieth[1] && manieth[1] < manieth[2]) {
      answer = manieth[0] + 1;
    } else {
      answer = manieth[0];
    }
    System.out.print(answer);
    System.out.print(answer);
    System.out.print(answer);
	}
}
