Leaf in the cage#520

Leaf in the cage

1 second
64 megabytes
Hard (≈1650)

On a square piece of paper the size of N×N cells K drew different rectangles with the sides on the lines of the grid. Knowing the coordinates of pairs of opposite vertices of each rectangle in the rectangular coordinate system whose origin lezhit in one of the extreme points of the leaf, and the axes coincide with its sides, calculate how many pieces fall apart a piece of paper, if you make the cuts on each side of the rectangle.

Input

In the first runoff of N and K. The following K lines of four non-negative integers - the coordinates of two opposite vertices of each rectangle. All numeric values ​​are non-negative integers, not greater than 100.

Output

The answer to the problem.

Examples

Example 1

Loading
Loading