
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  }


} import java.io.FileNotFoundException; FileNotFoundException java.io import java.io.FileReader; FileReader java.io import java.util.HashSet; HashSet java.util import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  }


} Main public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  } main {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  } Scanner cin = new Scanner (System.in); cin new Scanner (System.in) int num = cin.nextInt(); num cin.nextInt() cin.nextInt cin int numTemp = 0; numTemp 0 for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    } int i=1; int i=1; i 1 i<=9 i 9 i++ i++ i {
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    } {
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    } numTemp = i+i*10+i*100 numTemp i+i*10+i*100 i+i*10+i*100 i i*10 i 10 i*100 i 100 if (numTemp >= num) break; numTemp >= num numTemp num break; System.out.println(numTemp) System.out.println System.out System System.out numTemp String[] args args public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  }


} public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  }


} Main

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.util.HashSet;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) throws FileNotFoundException {

//    Scanner cin = new Scanner(new FileReader("input.txt"));
    Scanner cin = new Scanner (System.in);

    int num = cin.nextInt();
    int numTemp = 0;
    for (int i=1;i<=9;i++){
      numTemp = i+i*10+i*100;
      if (numTemp >= num) break;
    }
    System.out.println(numTemp);

  }


}