#include <bits/stdc++.h>
using namespace std;
struct Product{
long long s,d;
};
bool cmp(Product x,Product y){
return x.d<y.d;
}
vector<Product> a;
int main() {
int n;
cin>>n;
for(int i=0;i<n;i++){
Product t;
long long x;
cin>>t.s>>x;
t.d=t.s+x;
a.push_back(t);
}
sort(a.begin(),a.end(),cmp);
long long now=a[0].s+1,ans=1;
for(int i=1;i<n;i++){
if(now<=a[i].d){
if(now<a[i].s){
now=a[i].s;
}else{
now+=1;
}
ans++;
}
}
cout<<ans;
return 0;
}