public static void main ( String [ ] args ) {
  Scanner sc = new Scanner ( System . in ) ;
  int N = sc . nextInt ( ) ;
  if ( 100 <= N && N <= 111 ) {
    System . out . println ( 111 ) ;
  }
  else if ( 112 <= N && N <= 222 ) {
    System . out . println ( 222 ) ;
  }
  else if ( 223 <= N && N <= 333 ) {
    System . out . println ( 333 ) ;
  }
  else if ( 334 <= N && N <= 444 ) {
    System . out . println ( 444 ) ;
  }
  else if ( 445 <= N && N <= 555 ) {
    System . out . println ( 555 ) ;
  }
  else if ( 556 <= N && N <= 666 ) {
    System . out . println ( 666 ) ;
  }
  else if ( 667 <= N && N <= 777 ) {
    System . out . println ( 777 ) ;
  }
  else if ( 778 <= N && N <= 888 ) {
    System . out . println ( 888 ) ;
  }
  else if ( 889 <= N && N <= 999 ) {
    System . out . println ( 999 ) ;
  }
}

public static void main ( String [ ] args ) { Scanner sc = new Scanner ( System . in ) ; int N = sc . nextInt ( ) ; if ( 100 <= N && N <= 111 ) { System . out . println ( 111 ) ; } else if ( 112 <= N && N <= 222 ) { System . out . println ( 222 ) ; } else if ( 223 <= N && N <= 333 ) { System . out . println ( 333 ) ; } else if ( 334 <= N && N <= 444 ) { System . out . println ( 444 ) ; } else if ( 445 <= N && N <= 555 ) { System . out . println ( 555 ) ; } else if ( 556 <= N && N <= 666 ) { System . out . println ( 666 ) ; } else if ( 667 <= N && N <= 777 ) { System . out . println ( 777 ) ; } else if ( 778 <= N && N <= 888 ) { System . out . println ( 888 ) ; } else if ( 889 <= N && N <= 999 ) { System . out . println ( 999 ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) body: (block (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (decimal_integer_literal) right: (identifier)) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))))))))))))