Rectangular division#1067

Rectangular division

3 seconds
64 megabytes
Easy

Given rectangles whose sides are parallel to the coordinate axes. Determine into how many regions these rectangles divide the plane (inside each region there should be no boundary of any rectangle).

Input

The first line contains the number of rectangles (1 \leq N \leq 100). Each of the next lines contains four numbers: x_1, y_1, x_2, y_2 — the coordinates of two opposite corners of a rectangle. All coordinates are integers and their absolute values do not exceed .

Output

Print one number — the number of regions into which the plane is divided.

Examples

Example 1

Loading
Loading