public static void main ( String [ ] args ) throws IOException {
  Scanner input = new Scanner ( System . in ) ;
  int n = input . nextInt ( ) ;
  int a = input . nextInt ( ) - 1 ;
  int b = input . nextInt ( ) - 1 ;
  String s = input . next ( ) ;
  if ( s . charAt ( b ) == s . charAt ( a ) ) {
    System . out . println ( "0" ) ;
  }
  else {
    int min = Math . min ( a , b ) ;
    int max = Math . max ( a , b ) ;
    String sub = s . substring ( min + 1 , max ) ;
    int first = ( min + 1 ) + sub . indexOf ( ( s . charAt ( max ) == '1' ) ? "1" : "0" ) ;
    if ( first < 0 ) {
      System . out . println ( Math . abs ( min - max ) ) ;
      return ;
    }
    else System . out . println ( "1" ) ;
  }
}

public static void main ( String [ ] args ) throws IOException { Scanner input = new Scanner ( System . in ) ; int n = input . nextInt ( ) ; int a = input . nextInt ( ) - 1 ; int b = input . nextInt ( ) - 1 ; String s = input . next ( ) ; if ( s . charAt ( b ) == s . charAt ( a ) ) { System . out . println ( "0" ) ; } else { int min = Math . min ( a , b ) ; int max = Math . max ( a , b ) ; String sub = s . substring ( min + 1 , max ) ; int first = ( min + 1 ) + sub . indexOf ( ( s . charAt ( max ) == '1' ) ? "1" : "0" ) ; if ( first < 0 ) { System . out . println ( Math . abs ( min - max ) ) ; return ; } else System . out . println ( "1" ) ; } }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (type_identifier) dimensions: (dimensions)) name: (identifier))) (throws (type_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)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)) right: (decimal_integer_literal)))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))) consequence: (block (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal))))) alternative: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (identifier))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (decimal_integer_literal)) (identifier))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (ternary_expression condition: (parenthesized_expression (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal))) consequence: (string_literal) alternative: (string_literal))))))) (if_statement condition: (parenthesized_expression (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (binary_expression left: (identifier) right: (identifier))))))) (return_statement)) alternative: (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (string_literal)))))))))