Colored Rectangles#199

Colored Rectangles

1 second
64 megabytes
Medium

When Vitek learned about the Pythagorean theorem in geometry class, he momentarily put aside his dreams of becoming a politician and decided to pursue a career in mathematics. He realized that true values are found only in science, and the names of great mathematicians are always remembered. The very next day after making this life-changing decision, he began preparing for future discoveries.

He drew a coordinate system on graph paper and started sketching rectangles in the first quadrant. None of these rectangles overlapped or touched each other. After drawing rectangles, he began to color them. Rectangles fully visible from the origin were colored green; those partially visible were colored red; and those not visible at all from the origin were colored blue.

He was most interested in the following: how many rectangles did he color blue?

Input

The first line contains the number of rectangles , where 1 \leq N \leq 1000. Each of the next lines contains integers separated by spaces: the coordinates of the lower left and upper right corners of each rectangle.

0 < X_1, Y_1, X_2, Y_2 \leq 30000

Output

Print a single integer: the number of rectangles colored blue.

Examples

Example 1

Loading
Loading