#D97. Union of Rectangles
Union of Rectangles
Union of Rectangles
Given a set of axis-aligned rectangles in the plane, find the area of regions which are covered by at least one rectangle.
Constraints
Input
The input is given in the following format.
:
() and () are the coordinates of the top-left corner and the bottom-right corner of the -th rectangle respectively.
Output
Print the area of the regions.
Examples
Input
2 0 0 3 4 1 2 4 3
Output
13
Input
3 1 1 2 5 2 1 5 2 1 2 2 5
Output
7
Input
4 0 0 3 1 0 0 1 3 0 2 3 3 2 0 3 3
Output
8
inputFormat
Input
The input is given in the following format.
:
() and () are the coordinates of the top-left corner and the bottom-right corner of the -th rectangle respectively.
outputFormat
Output
Print the area of the regions.
Examples
Input
2 0 0 3 4 1 2 4 3
Output
13
Input
3 1 1 2 5 2 1 5 2 1 2 2 5
Output
7
Input
4 0 0 3 1 0 0 1 3 0 2 3 3 2 0 3 3
Output
8
样例
4
0 0 3 1
0 0 1 3
0 2 3 3
2 0 3 3
8