static private int run ( ) {
  String s = scanner . next ( ) ;
  int k = scanner . nextInt ( ) ;
  char [ ] arr = s . toCharArray ( ) ;
  int count = 0 ;
  for ( int i = 0 ;
  i < arr . length ;
  i ++ ) {
    if ( arr [ i ] == '-' ) {
      if ( i + k > arr . length ) {
        return - 1 ;
      }
      count ++ ;
      for ( int j = i ;
      j < i + k ;
      j ++ ) {
        arr [ j ] = ( arr [ j ] == '+' ? '-' : '+' ) ;
      }
    }
  }
  return count ;
}

static private int run ( ) { String s = scanner . next ( ) ; int k = scanner . nextInt ( ) ; char [ ] arr = s . toCharArray ( ) ; int count = 0 ; for ( int i = 0 ; i < arr . length ; i ++ ) { if ( arr [ i ] == ' - ' ) { if ( i + k > arr . length ) { return - 1 ; } count ++ ; for ( int j = i ; j < i + k ; j ++ ) { arr [ j ] = ( arr [ j ] == ' + ' ? ' - ' : ' + ' ) ; } } } return count ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (type_identifier) 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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) 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: (decimal_integer_literal))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal))) consequence: (block (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (identifier)) right: (field_access object: (identifier) field: (identifier)))) consequence: (block (return_statement (unary_expression operand: (decimal_integer_literal))))) (expression_statement (update_expression (identifier))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (identifier))) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (parenthesized_expression (ternary_expression condition: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (character_literal)) consequence: (character_literal) alternative: (character_literal))))))))))) (return_statement (identifier))))