public static void process ( ) throws IOException {
  int n = ni ( ) ;
  int dp [ ] [ ] = new int [ n + 1 ] [ 2 ] ;
  long pp = 0l ;
  long np = 0l ;
  for ( int i = 1 ;
  i <= n ;
  i ++ ) {
    int a = ni ( ) ;
    if ( a > 0 ) {
      dp [ i ] [ 0 ] = 1 + dp [ i - 1 ] [ 0 ] ;
      dp [ i ] [ 1 ] = dp [ i - 1 ] [ 1 ] ;
    }
    else {
      dp [ i ] [ 0 ] = dp [ i - 1 ] [ 1 ] ;
      dp [ i ] [ 1 ] = 1 + dp [ i - 1 ] [ 0 ] ;
    }
    pp += dp [ i ] [ 0 ] ;
    np += dp [ i ] [ 1 ] ;
  }
  pn ( np + " " + pp ) ;
}

public static void process ( ) throws IOException { int n = ni ( ) ; int dp [ ] [ ] = new int [ n + 1 ] [ 2 ] ; long pp = 0l ; long np = 0l ; for ( int i = 1 ; i <= n ; i ++ ) { int a = ni ( ) ; if ( a > 0 ) { dp [ i ] [ 0 ] = 1 + dp [ i - 1 ] [ 0 ] ; dp [ i ] [ 1 ] = dp [ i - 1 ] [ 1 ] ; } else { dp [ i ] [ 0 ] = dp [ i - 1 ] [ 1 ] ; dp [ i ] [ 1 ] = 1 + dp [ i - 1 ] [ 0 ] ; } pp += dp [ i ] [ 0 ] ; np += dp [ i ] [ 1 ] ; } pn ( np + " ▁ " + pp ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) (throws (type_identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation 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 (binary_expression left: (identifier) right: (decimal_integer_literal))) dimensions: (dimensions_expr (decimal_integer_literal))))) (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: (identifier)) update: (update_expression (identifier)) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation name: (identifier) arguments: (argument_list)))) (if_statement condition: (parenthesized_expression (binary_expression left: (identifier) right: (decimal_integer_literal))) consequence: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (binary_expression left: (decimal_integer_literal) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (decimal_integer_literal))))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (decimal_integer_literal))))) alternative: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)) right: (binary_expression left: (decimal_integer_literal) right: (array_access array: (array_access array: (identifier) index: (binary_expression left: (identifier) right: (decimal_integer_literal))) index: (decimal_integer_literal))))))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)))) (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (decimal_integer_literal)))))) (expression_statement (method_invocation name: (identifier) arguments: (argument_list (binary_expression left: (binary_expression left: (identifier) right: (string_literal)) right: (identifier)))))))