public static void main ( String [ ] args ) throws IOException {
  BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ;
  PrintWriter pw = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ;
  n = Integer . parseInt ( br . readLine ( ) ) ;
  StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ;
  nums = new long [ n ] ;
  for ( int i = 0 ;
  i < n ;
  i ++ ) nums [ i ] = Long . parseLong ( st . nextToken ( ) ) ;
  long sum = nums [ 0 ] ;
  if ( sum == 0 ) pw . println ( Math . min ( solve ( 1L , 1L ) , solve ( - 1L , 1L ) ) ) ;
  else if ( sum > 0 ) pw . println ( Math . min ( solve ( sum , 0L ) , solve ( - 1L , sum + 1L ) ) ) ;
  else if ( sum < 0 ) pw . println ( Math . min ( solve ( sum , 0L ) , solve ( 1L , - sum + 1L ) ) ) ;
  br . close ( ) ;
  pw . close ( ) ;
  System . exit ( 0 ) ;
}

public static void main ( String [ ] args ) throws IOException { BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; PrintWriter pw = new PrintWriter ( new BufferedWriter ( new OutputStreamWriter ( System . out ) ) ) ; n = Integer . parseInt ( br . readLine ( ) ) ; StringTokenizer st = new StringTokenizer ( br . readLine ( ) ) ; nums = new long [ n ] ; for ( int i = 0 ; i < n ; i ++ ) nums [ i ] = Long . parseLong ( st . nextToken ( ) ) ; long sum = nums [ 0 ] ; if ( sum == 0 ) pw . println ( Math . min ( solve ( 1L , 1L ) , solve ( - 1L , 1L ) ) ) ; else if ( sum > 0 ) pw . println ( Math . min ( solve ( sum , 0L ) , solve ( - 1L , sum + 1L ) ) ) ; else if ( sum < 0 ) pw . println ( Math . min ( solve ( sum , 0L ) , solve ( 1L , - sum + 1L ) ) ) ; br . close ( ) ; pw . close ( ) ; System . exit ( 0 ) ; }
(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 (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (object_creation_expression type: (type_identifier) arguments: (argument_list (field_access object: (identifier) field: (identifier)))))))))) (expression_statement (assignment_expression left: (identifier) right: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (local_variable_declaration type: (type_identifier) declarator: (variable_declarator name: (identifier) value: (object_creation_expression type: (type_identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))))) (expression_statement (assignment_expression left: (identifier) right: (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 (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))))))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (array_access array: (identifier) index: (decimal_integer_literal)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (decimal_integer_literal))) (method_invocation name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal)) (decimal_integer_literal)))))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))) (method_invocation name: (identifier) arguments: (argument_list (unary_expression operand: (decimal_integer_literal)) (binary_expression left: (identifier) right: (decimal_integer_literal))))))))) alternative: (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (method_invocation name: (identifier) arguments: (argument_list (identifier) (decimal_integer_literal))) (method_invocation name: (identifier) arguments: (argument_list (decimal_integer_literal) (binary_expression left: (unary_expression operand: (identifier)) right: (decimal_integer_literal)))))))))))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list))) (expression_statement (method_invocation object: (identifier) name: (identifier) arguments: (argument_list (decimal_integer_literal))))))