There are n rectangles drawn on the plane. Every rectangle has sides parallel to the coordinate axes, and all of its vertices have integer coordinates. A block is defined as follows.
Here, two rectangles 'have a common segment' when the region in which they overlap contains a segment of positive length. Concretely, two rectangles belong to the same block if they share part of an edge or overlap over an area of positive size. Conversely, if two rectangles meet only at a single point (a corner) or do not meet at all, they belong to different blocks.
The rectangles in the first figure below form two separate blocks.

The rectangles in the second figure below form a single block.

Given the number of rectangles and the coordinates of their vertices on standard input, write a program that finds the number of separate blocks formed by the rectangles and writes it to standard output.
The first line contains the number of rectangles n (1≤n≤7000). Each of the next n lines describes one rectangle with four integers: the x and y coordinates of its bottom-left vertex, followed by the x and y coordinates of its top-right vertex. All coordinates are non-negative integers not greater than 10000.
Print a single integer: the number of separate blocks formed by the given rectangles.