Painting the Wall

No attempts yetTime limit1sMemory limit128 MB

Problem

It is time to repaint the apartment again. Bajtazar is not fond of painting, but he noticed that the paint cans and brushes sparked lively interest among his children. So he handed out the brushes and asked the children to paint one of the walls. Each child painted a rectangular region whose sides are parallel or perpendicular to the floor.

Unfortunately, the paint Bajtazar bought is not of the best quality, so the only parts of the wall that look good now are those that were skipped (left unpainted) by at most one child. What is the total area of those parts?

Input

The first line contains an integer nn (2n5000002 \le n \le 500000), the number of Bajtazar's children.

Each of the next nn lines describes the region painted by one child. The ii-th of these lines contains four integers x1x_1, y1y_1, x2x_2, y2y_2 (0x1<x21090 \le x_1 < x_2 \le 10^9, 0y1<y21090 \le y_1 < y_2 \le 10^9). They mean that the ii-th child painted the rectangle whose lower-left corner is at (x1,y1)(x_1, y_1) and upper-right corner is at (x2,y2)(x_2, y_2), with sides parallel to the coordinate axes.

Output

Print a single integer: the area of the part of the wall that needs no further painting, that is, the part painted by at least n1n-1 children.

Hint

The regions painted in the darker and the darkest colors in the figure are included in the result.