Checkered sheet#2998

Checkered sheet

1 second
64 megabytes
Easy

On a square sheet of paper with an N \times N grid, different rectangles are drawn. Each rectangle's sides lie along the lines of the grid. For each rectangle, the coordinates of a pair of opposite vertices are given in a rectangular coordinate system, where the origin is at one edge of the sheet and the axes coincide with its sides. Determine into how many pieces the sheet will be divided if cuts are made along each side of every rectangle.

Input

The first line contains and . Each of the following lines contains four non-negative integers: the coordinates of two opposite vertices of each rectangle. All numerical values are non-negative integers not greater than .

Output

Print the answer to the problem.

Examples

Example 1

Loading
Loading