public static void solve ( ) {
  int n = scan . nextInt ( ) ;
  int [ ] [ ] a = new int [ 1005 ] [ 1005 ] ;
  int cnt = 0 ;
  for ( int i = 0 ;
  i < 1000 ;
  i ++ ) {
    for ( int j = 0 ;
    j < 1000 ;
    j ++ ) {
      a [ i ] [ j ] = 0 ;
    }
  }
  for ( int k = 0 ;
  k < n ;
  k ++ ) {
    int x1 = scan . nextInt ( ) ;
    int y1 = scan . nextInt ( ) ;
    int x2 = scan . nextInt ( ) ;
    int y2 = scan . nextInt ( ) ;
    for ( int i = x1 ;
    i <= x2 ;
    i ++ ) {
      for ( int j = y1 ;
      j <= y2 ;
      j ++ ) {
        a [ i ] [ j ] ++ ;
      }
    }
  }
  for ( int i = 0 ;
  i <= 100 ;
  i ++ ) {
    for ( int j = 0 ;
    j <= 100 ;
    j ++ ) {
      cnt += a [ i ] [ j ] ;
    }
  }
  System . out . println ( cnt ) ;
}

public static void solve ( ) { int n = scan . nextInt ( ) ; int [ ] [ ] a = new int [ 1005 ] [ 1005 ] ; int cnt = 0 ; for ( int i = 0 ; i < 1000 ; i ++ ) { for ( int j = 0 ; j < 1000 ; j ++ ) { a [ i ] [ j ] = 0 ; } } for ( int k = 0 ; k < n ; k ++ ) { int x1 = scan . nextInt ( ) ; int y1 = scan . nextInt ( ) ; int x2 = scan . nextInt ( ) ; int y2 = scan . nextInt ( ) ; for ( int i = x1 ; i <= x2 ; i ++ ) { for ( int j = y1 ; j <= y2 ; j ++ ) { a [ i ] [ j ] ++ ; } } } for ( int i = 0 ; i <= 100 ; i ++ ) { for ( int j = 0 ; j <= 100 ; j ++ ) { cnt += a [ i ] [ j ] ; } } System . out . println ( cnt ) ; }
(method_declaration (modifiers) type: (void_type) name: (identifier) parameters: (formal_parameters) body: (block (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (array_type element: (integral_type) dimensions: (dimensions)) declarator: (variable_declarator name: (identifier) value: (array_creation_expression type: (integral_type) dimensions: (dimensions_expr (decimal_integer_literal)) dimensions: (dimensions_expr (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)) right: (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 object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (method_invocation object: (identifier) name: (identifier) arguments: (argument_list)))) (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (identifier))) condition: (binary_expression left: (identifier) right: (identifier)) update: (update_expression (identifier)) body: (block (expression_statement (update_expression (array_access array: (array_access array: (identifier) index: (identifier)) index: (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: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (for_statement init: (local_variable_declaration type: (integral_type) declarator: (variable_declarator name: (identifier) value: (decimal_integer_literal))) condition: (binary_expression left: (identifier) right: (decimal_integer_literal)) update: (update_expression (identifier)) body: (block (expression_statement (assignment_expression left: (identifier) right: (array_access array: (array_access array: (identifier) index: (identifier)) index: (identifier)))))))) (expression_statement (method_invocation object: (field_access object: (identifier) field: (identifier)) name: (identifier) arguments: (argument_list (identifier))))))