Mountain View#10334

Mountain View

1 Sekunde
128 Megabyte
Mittel

From her pasture on the farm, Bessie the cow gazes at the mountain range on the horizon. In front of her are mountains, each of which is an isosceles triangle pointing upward. The base of each mountain lies on the -axis, and its sides form a 45^\circ angle with the base, so the peak of each mountain forms a right angle. Mountain is uniquely defined by the coordinates of its peak — the point (x_i, y_i). No two mountains have the same peak coordinates.

However, since all the mountains are roughly the same color, Bessie cannot see a mountain if its peak lies on or inside the triangular shape of another mountain.

Determine how many mountain peaks Bessie can see.

Eingabe

The first line contains an integer n~(1 \le n \le 10^5).

Each of the following lines contains two integers x_i~(0 \le x_i \le 10^9) and y_i~(1 \le y_i \le 10^9) — the coordinates of the peak of a mountain.

Ausgabe

Print a single integer — the number of mountains whose peaks are visible to Bessie.

Beispiele

In this example, Bessie can see the first and the last mountain. The second mountain is hidden behind the first one.

Beispiel 1

Loading
Loading