public static int findmin ( int [ ] arr ) {
  int sum = 0 ;
  for ( int i = 1 ;
  i < arr . length ;
  i ++ ) {
    int count = 0 ;
    while ( i < arr . length && arr [ i ] == 0 ) {
      i ++ ;
      count ++ ;
    }
    if ( count % 2 != 0 ) {
      sum = sum + count / 2 + 1 ;
    }
    else sum = sum + count / 2 ;
  }
  return sum ;
}

public static int findmin ( int [ ] arr ) { int sum = 0 ; for ( int i = 1 ; i < arr . length ; i ++ ) { int count = 0 ; while ( i < arr . length && arr [ i ] == 0 ) { i ++ ; count ++ ; } if ( count % 2 != 0 ) { sum = sum + count / 2 + 1 ; } else sum = sum + count / 2 ; } return sum ; }
(method_declaration (modifiers) type: (integral_type) name: (identifier) parameters: (formal_parameters (formal_parameter type: (array_type element: (integral_type) dimensions: (dimensions)) name: (identifier))) body: (block (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 (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) (while_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (field_access object: (identifier) field: (identifier))) right: (binary_expression left: (array_access array: (identifier) index: (identifier)) right: (decimal_integer_literal)))) body: (block (expression_statement (update_expression (identifier))) (expression_statement (update_expression (identifier))))) (if_statement condition: (parenthesized_expression (binary_expression left: (binary_expression left: (identifier) right: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal))) right: (decimal_integer_literal))))) alternative: (expression_statement (assignment_expression left: (identifier) right: (binary_expression left: (identifier) right: (binary_expression left: (identifier) right: (decimal_integer_literal)))))))) (return_statement (identifier))))