Untidy Desktops#6072

Untidy Desktops

1 second
64 megabytes
Easy

Many companies are moving towards "paperless offices" in an attempt to increase productivity. Unfortunately, people who are unorganized with papers are unorganized without papers too! Instead of having piles of paper scattered all over a desk, people have windows overlapping and covering one another. For these people, finding the right window on the computer screen is just as hard as finding the right piece of paper on the desk.

For this problem, you will be given the locations and sizes of windows on a computer desktop (1 \le n \le 50). You have been asked to evaluate how untidy the computer desktop is by counting the number of windows that overlap with at least one other window. Two windows overlap if at least one pixel is in both windows (including the boundary of the windows).

Input

The input will consist of multiple cases. Each case will start with a line containing a single integer . This will be followed by lines of the form

where , are the row and column coordinates of the upper left corner of the window, and , are the width and height of the window. You may assume that the upper left corner of the computer desktop has coordinates , the screen has rows and columns, and all windows are completely within the boundary of the screen. A value of n = 0 will terminate the input.

Output

For each test case, print on a single line the number of windows that overlap with at least one other window.

Examples

Example 1

Loading
Loading