Combining Rectangles#4109

Combining Rectangles

1 second
64 megabytes
Easy

Given rectangles with sides aligned to the coordinate axes, your task is to calculate the area of the shape formed by the union of these rectangles.

Keep in mind that the resulting shape may consist of separate parts.

Input

The first line contains the integer (1 \le N \le 100), representing the number of rectangles. The following lines each contain integers: x_1, y_1, x_2, y_2, which are the coordinates of two opposite corners of a rectangle. The coordinates are integers and can range up to in absolute value.

Output

Output the total area of the figure formed by the union of the rectangles.

Explanation for example 1:

Examples

Example 1

Loading
Loading