#P983D. Arkady and Rectangles

Arkady and Rectangles

No submission language available for this problem.

Description

Arkady has got an infinite plane painted in color 00. Then he draws nn rectangles filled with paint with sides parallel to the Cartesian coordinate axes, one after another. The color of the ii-th rectangle is ii (rectangles are enumerated from 11 to nn in the order he draws them). It is possible that new rectangles cover some of the previous ones completely or partially.

Count the number of different colors on the plane after Arkady draws all the rectangles.

The first line contains a single integer nn (1n1000001 \le n \le 100\,000) — the number of rectangles.

The ii-th of the next nn lines contains 44 integers x1x_1, y1y_1, x2x_2 and y2y_2 (109x1<x2109-10^9 \le x_1 < x_2 \le 10^9, 109y1<y2109-10^9 \le y_1 < y_2 \le 10^9) — the coordinates of corners of the ii-th rectangle.

In the single line print the number of different colors in the plane, including color 00.

Input

The first line contains a single integer nn (1n1000001 \le n \le 100\,000) — the number of rectangles.

The ii-th of the next nn lines contains 44 integers x1x_1, y1y_1, x2x_2 and y2y_2 (109x1<x2109-10^9 \le x_1 < x_2 \le 10^9, 109y1<y2109-10^9 \le y_1 < y_2 \le 10^9) — the coordinates of corners of the ii-th rectangle.

Output

In the single line print the number of different colors in the plane, including color 00.

Samples

Sample Input 1

5
-1 -1 1 1
-4 0 0 4
0 0 4 4
-4 -4 0 0
0 -4 4 0

Sample Output 1

5

Sample Input 2

4
0 0 4 4
-4 -4 0 0
0 -4 4 0
-2 -4 2 4

Sample Output 2

5

Note

That's how the plane looks in the first sample

That's how the plane looks in the second sample

00 = white, 11 = cyan, 22 = blue, 33 = purple, 44 = yellow, 55 = red.