private static void test ( final Scanner sc , final PrintWriter pw ) {
  final int Smax = sc . nextInt ( ) ;
  final String levels = sc . next ( ) ;
  final int [ ] ls = new int [ levels . length ( ) ] ;
  int ts = 0 ;
  int toAdd = 0 ;
  for ( int i = 0 ;
  i < levels . length ( ) ;
  i ++ ) {
    if ( ts < i ) {
      toAdd += ( i - ts ) ;
      ts = i ;
    }
    ls [ i ] = levels . charAt ( i ) - '0' ;
    ts += ls [ i ] ;
  }
  pw . print ( toAdd ) ;
}

private static void test ( final Scanner sc , final PrintWriter pw ) { final int Smax = sc . nextInt ( ) ; final String levels = sc . next ( ) ; final int [ ] ls = new int [ levels . length ( ) ] ; int ts = 0 ; int toAdd = 0 ; for ( int i = 0 ; i < levels . length ( ) ; i ++ ) { if ( ts < i ) { toAdd += ( i - ts ) ; ts = i ; } ls [ i ] = levels . charAt ( i ) - '0' ; ts += ls [ i ] ; } pw . print ( toAdd ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters (formal_parameter (modifiers) type: (type_identifier) name: (identifier)) (formal_parameter (modifiers) type: (type_identifier) name: (identifier))) body: (block (local_variable_declaration (modifiers) type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration (modifiers) type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (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: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) update: (update_expression (identifier)) body: (block (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (parenthesized_expression (binary_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (identifier) right: (identifier))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))) right: (character_literal)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (identifier) index: (identifier)))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier))))))