The Sea is not for Fish
In an archipelago, in the middle of the Pacific Ocean, the economy is governed by fishing, as fish is the main food available. Lately, the population of this archipelago has increased dramatically, which has led to a large increase in fishing, and consequently to problems.
In this archipelago, every fisher goes to the high seas every day to bring as many fish as possible to his village. With the expansion of fishing, fishers are starting to throw their fishing nets over other fishermen's. As a result, fishers lose out as only the first fisherman catches the fish from the intersection between the nets.
The Island Fishermen's Association decided to survey to find out how much of the sea is actually being used, i.e. which area of the sea is covered by at least one fishing net.
As there are many intersections between the fishing nets, it is tough for the association to calculate the total area of the region covered by the nets. For this reason, they have asked you to write a programme to solve this problem.
As it is tough to navigate through the sea, fishers always throw their nets so that the regions covered by each net are always rectangles with sides parallel to the axes, if we imagine the sea as a Cartesian plane.
Input
The first line has an integer indicating the number of nets that have been launched. The next lines describe the regions covered by the nets: each contains four integers and , and . The region covered by the net in question contains every point () such that and .
Output
The out must contain only one line containing the area of the sea region actually used by fishermen, i.e. the total area of the sea region covered by at least one fishing net.
Constraints
Input Samples | Output Samples |
---|---|
2 1 3 1 3 2 4 2 4 |
7
|
3 1 6 1 2 3 7 1 2 2 5 1 2 |
6
|