Chain Detonation

Place one extra bomb past the last one with unlimited power to destroy as many not-yet-detonated bombs, minimizing the duds among the original bombs.

Medium6GreedyIntervalsImplementationInterviewNo attempts yetTime limit2sMemory limit512 MB

Problem

A demolition crew placed NN bombs in a row. The bombs are numbered 11 to NN from left to right. Bomb ii sits at coordinate xix_i and has destructive power pip_i.

Every timer was set to the same duration, but the crew planted the bombs starting from the right, so a bomb further to the right goes off slightly earlier. The detonation order is bomb NN, bomb N1N-1, ..., bomb 11.

When bomb ii detonates, it destroys everything within distance pip_i to its left, that is, everything in the coordinate interval [xipi, xi][x_i - p_i,\ x_i]. Bombs that have not gone off yet are destroyed too. A destroyed bomb never detonates, and it counts as a dud.

To cut down on duds you plant one extra bomb. You may place it at any coordinate greater than xNx_N and give it as much destructive power as you want, and it always detonates before every bomb that is already on the ground. Bombs destroyed by the extra bomb count as duds too. You may also place the extra bomb so that it destroys nothing.

Find the smallest number of duds you can end up with after planting one extra bomb.

Input

The first line contains the number of bombs NN (1N1000001 \le N \le 100000).

Each of the next NN lines contains the coordinate xix_i (0xi10000000 \le x_i \le 1000000) and the destructive power pip_i (1pi10000001 \le p_i \le 1000000) of bomb ii, separated by a space. The coordinates are given in increasing order, so x1<x2<<xNx_1 < x_2 < \dots < x_N, and no two bombs share a coordinate.

Output

Print, on one line, the smallest number of duds that one extra bomb can leave.