public static void main ( String [ ] __ ) {
  n = s . nextInt ( ) ;
  long a [ ] = new long [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) a [ i ] = s . nextInt ( ) ;
  if ( a [ 0 ] != 0 ) {
    long r1 = solve ( Arrays . copyOf ( a , a . length ) ) ;
    long r2 = Math . abs ( a [ 0 ] ) + 1 ;
    a [ 0 ] = - a [ 0 ] / Math . abs ( a [ 0 ] ) ;
    r2 += solve ( Arrays . copyOf ( a , a . length ) ) ;
    System . out . println ( Math . min ( r1 , r2 ) ) ;
  }
  else {
    a [ 0 ] = 1 ;
    long r1 = 1 + solve ( Arrays . copyOf ( a , a . length ) ) ;
    a [ 0 ] = - 1 ;
    long r2 = 1 + solve ( Arrays . copyOf ( a , a . length ) ) ;
    System . out . println ( Math . min ( r1 , r2 ) ) ;
  }
}

public static void main ( String [ ] __ ) { n = s . nextInt ( ) ; long a [ ] = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) a [ i ] = s . nextInt ( ) ; if ( a [ 0 ] != 0 ) { long r1 = solve ( Arrays . copyOf ( a , a . length ) ) ; long r2 = Math . abs ( a [ 0 ] ) + 1 ; a [ 0 ] = - a [ 0 ] / Math . abs ( a [ 0 ] ) ; r2 += solve ( Arrays . copyOf ( a , a . length ) ) ; System . out . println ( Math . min ( r1 , r2 ) ) ; } else { a [ 0 ] = 1 ; long r1 = 1 + solve ( Arrays . copyOf ( a , a . length ) ) ; a [ 0 ] = - 1 ; long r2 = 1 + solve ( Arrays . copyOf ( a , a . length ) ) ; System . out . println ( Math . min ( r1 , r2 ) ) ; } }
(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 (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) dimensions: (dimensions) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (identifier))))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (expression_statement (assignment_expression left: (array_access array: (identifier) index: (identifier)) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))) (if_statement condition: (parenthesized_expression (binary_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal))) consequence: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal)))) right: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (binary_expression left: (unary_expression operand: (array_access array: (identifier) index: (decimal_integer_literal))) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (array_access array: (identifier) index: (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier)))))))) (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 (identifier) (identifier))))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (decimal_integer_literal))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier))))))))) (expression_statement (assignment_expression left: (array_access array: (identifier) index: (decimal_integer_literal)) right: (unary_expression operand: (decimal_integer_literal)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (binary_expression left: (decimal_integer_literal) right: (method_invocation name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (identifier) (field_access object: (identifier) field: (identifier))))))))) (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 (identifier) (identifier))))))))))