e-olymp
favorite We need a little bit of your help to keep things running, click on this banner to learn more
Problems

Windows

Windows

Onthe Windows desktop,openNwindows.Knowncoordinates of the upper-left corner ofx[i], y[i]as well as thewidthandheightof each windoww[i], h[i] (i=1..N). How manywindowsarevisible on the screen?The windowisvisible,if notcompletelycovered withother windowsopen afterhim.

prb2397

Input

In theline of the fileis writtenpevoyone numberN - the numberof windows.In the nextN linesoffour numbers - x[i], y[i], w[i], h[i] (i = 1..N). The procedureof openingthe windowsto their ordercorresponds tothe input data.All values are natural anddo not exceed1000.

Output

A single number- the number ofvisible windowson 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