// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <cmath>
#include <iomanip>
#define dibs reserve
#define OVER9000 1234567890
#define patkan 9
#define tisic 47
#define soclose 1e-9
#define pi 3.1415926535898
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define chocolate win
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):(x))
#define uint unsigned int
#include <time.h>
// mylittlepony
using namespace std;
struct edge {
int u,v,r;
bool operator<(const edge &E) const {
return r < E.r;}
};
int main() {
cin.sync_with_stdio(0);
int N;
cin >> N;
vector<edge> E(N);
map<int,int> P;
for(int i =0; i < N; i++) {
int r,x;
cin >> x >> r;
P[x-r] =0, P[x+r] =0;
E[i].u =x-r;
E[i].v =x+r;
E[i].r =r;}
sort(E.begin(),E.end());
int V =0;
ALL_THE(P,it) {it->ss =V; V++;}
vector< vector<int> > C(V);
vector<int> isC(V);
int ans =N;
for(int i =0; i < V; i++) {
C[i].push_back(i);
isC[i] =i;}
for(int i =0; i < N; i++) {
int x =isC[P[E[i].u]], y =isC[P[E[i].v]];
if(x == y) {
ans++;
continue;}
if(C[x].size() > C[y].size()) swap(x,y);
for(int j =0; j < C[x].size(); j++) {
isC[C[x][j]] =y;
C[y].push_back(C[x][j]);}
}
cout << ans+1 << "\n";
return 0;}
// look at my code
// my code is amazing
Ly8gaW9zdHJlYW0gaXMgdG9vIG1haW5zdHJlYW0KI2luY2x1ZGUgPGNzdGRpbz4KLy8gYml0Y2ggcGxlYXNlCiNpbmNsdWRlIDxpb3N0cmVhbT4KI2luY2x1ZGUgPHZlY3Rvcj4KI2luY2x1ZGUgPHNldD4KI2luY2x1ZGUgPG1hcD4KI2luY2x1ZGUgPHN0cmluZz4KI2luY2x1ZGUgPHF1ZXVlPgojaW5jbHVkZSA8c3RhY2s+CiNpbmNsdWRlIDxhbGdvcml0aG0+C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k7CiAgICBpbnQgViA9MDsKICAgIEFMTF9USEUoUCxpdCkge2l0LT5zcyA9VjsgVisrO30KIAogICAgdmVjdG9yPCB2ZWN0b3I8aW50PiA+IEMoVik7CiAgICB2ZWN0b3I8aW50PiBpc0MoVik7CiAgICBpbnQgYW5zID1OOwogICAgZm9yKGludCBpID0wOyBpIDwgVjsgaSsrKSB7CiAgICAgICAgQ1tpXS5wdXNoX2JhY2soaSk7CiAgICAgICAgaXNDW2ldID1pO30KIAogICAgZm9yKGludCBpID0wOyBpIDwgTjsgaSsrKSB7CiAgICAgICAgaW50IHggPWlzQ1tQW0VbaV0udV1dLCB5ID1pc0NbUFtFW2ldLnZdXTsKICAgICAgICBpZih4ID09IHkpIHsKICAgICAgICAgICAgYW5zKys7CiAgICAgICAgICAgIGNvbnRpbnVlO30KICAgICAgICBpZihDW3hdLnNpemUoKSA+IENbeV0uc2l6ZSgpKSBzd2FwKHgseSk7CiAgICAgICAgZm9yKGludCBqID0wOyBqIDwgQ1t4XS5zaXplKCk7IGorKykgewogICAgICAgICAgICBpc0NbQ1t4XVtqXV0gPXk7CiAgICAgICAgICAgIENbeV0ucHVzaF9iYWNrKENbeF1bal0pO30KICAgICAgICB9CiAgICBjb3V0IDw8IGFucysxIDw8ICJcbiI7CiAgICByZXR1cm4gMDt9CiAKLy8gbG9vayBhdCBteSBjb2RlCi8vIG15IGNvZGUgaXMgYW1hemluZw==
prog.cpp: In function ‘int main()’:
prog.cpp:20:31: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:54:5: note: in expansion of macro ‘ALL_THE’
ALL_THE(P,it) {it->ss =V; V++;}
^
prog.cpp:54:15: error: ‘it’ does not name a type
ALL_THE(P,it) {it->ss =V; V++;}
^
prog.cpp:20:36: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:54:15: error: expected ‘;’ before ‘it’
ALL_THE(P,it) {it->ss =V; V++;}
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:54:15: error: ‘it’ was not declared in this scope
ALL_THE(P,it) {it->ss =V; V++;}
^
prog.cpp:20:55: note: in definition of macro ‘ALL_THE’
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
^
prog.cpp:69:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int j =0; j < C[x].size(); j++) {
^