点转换成线段,然后简单贪心.....CF里神奇的贪心比较多.....
/* ***********************************************
Author :CKboss
Created Time :2015年04月10日 星期五 10时04分57秒
File Name :CF527D.cpp
************************************************ */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>
using namespace std;
const int maxn = 200200;
int n;
struct PT
{
int l,r;
}pt[maxn];
bool cmp(PT a,PT b)
{
if(a.r!=b.r) return a.r<b.r;
return a.l<b.l;
}
int main()
{
//freopen("in.txt","r",stdin);
//freopen("out.txt","w",stdout);
scanf("%d",&n);
for(int i=0;i<n;i++)
{
int x,y;
scanf("%d%d",&x,&y);
pt[i].l=x-y; pt[i].r=x+y;
}
sort(pt,pt+n,cmp);
int ans=0;
int R=-2000000000;
for(int i=0;i<n;i++)
{
if(pt[i].l>=R)
{
ans++; R=pt[i].r;
}
}
printf("%d\n",ans);
return 0;
}