eolymp
bolt
Try our new interface for solving problems
Problems

Windows

Windows

On the \textit{\textbf{Windows}} desktop, open N windows. Known coordinates of the upper-left corner of \textbf{x\[i\]}, \textbf{y\[i\]} as well as the width and height of each window \textbf{w\[i\]}, \textbf{h\[i\]} (\textbf{i=1..N}). How many windows are visible on the screen? The window is visible, if not completely covered with other windows open after him. \includegraphics{https://static.e-olymp.com/content/a2/a2a9c0d1cdb56f3c4550900323d6b5a20b3ceb17.jpg} \InputFile In the line of the file is written pevoy one number \textbf{N} - the number of windows. In the next \textbf{N} lines of four numbers - \textbf{x\[i\]}, \textbf{y\[i\]}, \textbf{w\[i\]}, \textbf{h\[i\]} (\textbf{i = 1..N}). The procedure of opening the windows to their order corresponds to the input data. All values are natural and do not exceed \textbf{1000}. \OutputFile A single number - the number of visible windows on the screen.
Time limit 1 second
Memory limit 64 MiB
Input example #1
4
5 3 2 5
2 4 6 2
1 3 3 7
3 1 6 6
Output example #1
3