Advertisement 2

아직 제출이 없습니다시간 제한2초메모리 제한1024 MB

문제

There are NN residents in JOI Kingdom, numbered from 11 to NN. Resident ii (1iN1 ≤ i ≤ N) lives at the coordinate X_iX\_i on the real line, and its power of influence is E_iE\_i. It may be the case that more than one residents live at the same coordinate. A resident with a large power of influence has a high advertising potential. But such a resident is careful in buying books.

Rie published a book on informatics. In order to encourage many people to buy copies of the book, she can donate copies of the book to some residents. If she donates a copy of the book to Resident ii (1iN1 ≤ i ≤ N), Resident ii will get a copy of Rie’s book. Moreover, among the residents who did not yet get copies of the book, every resident jj (1jN1 ≤ j ≤ N) satisfying the following condition will buy a copy of the book and get it.

The distance between Resident ii and Resident jj on the real line is less than or equal to E_iE_jE\_i - E\_j. In other words, X_iX_jE_iE_j|X\_i - X\_j| ≤ E\_i - E\_j is satisfied.

If all the residents read Rie’s book, the Olympiads in Informatics will be greatly recognized. Write a program which calculates the minimum number of residents who will be donated copies of Rie’s book so that all the residents in JOI Kingdom will get copies of Rie’s book.

입력

Read the following data from the standard input.

NN

X_1X\_1 E_1E\_1

X_2X\_2 E_2E\_2

\vdots

X_NX\_N E_NE\_N

출력

Write one line to the standard output. The output should contain the minimum number of residents who will be donated copies of Rie’s book.

제한

  • 1N500,0001 ≤ N ≤ 500\\,000.
  • 1X_i1091 ≤ X\_i ≤ 10^9 (1iN1 ≤ i ≤ N).
  • 1E_i1091 ≤ E\_i ≤ 10^9 (1iN1 ≤ i ≤ N).
  • Given values are all integers.