A floorplan is drawn as n axis-aligned rectangular rooms on an integer grid. Rectangles may overlap. Each rectangle is given by its lower-left corner (x1, y1) and its upper-right corner (x2, y2) with x1 < x2 and y1 < y2. Compute the total area covered by at least one rectangle (regions covered by several rectangles are counted only once).
Input format
Line 1: an integer n, the number of rectangles.
Next n lines: four integers x1 y1 x2 y2 describing a rectangle.
Output format
A single integer: the area of the union.
Constraints
- 1 <= n <= 1000
- -1000000000 <= x1 < x2 <= 1000000000
- -1000000000 <= y1 < y2 <= 1000000000