#include <bits/stdc++.h>   using namespace std;   const int MAXN = 200500;   int n;   pair<int, int> a[MAXN];   int b[MAXN];   int s[MAXN];   int FindMax(int j) {     int ret = 0;     for (; j >= 0; (j &= (j + 1))--) {       ret = max(ret, s[j]);     }     return ret;   }   void Update(int j, int x) {     for (; j < n; j |= (j + 1)) {       s[j] = max(s[j], x);     }   }   int main() {     cin >> n;     for (int i = 0; i < n; ++i) {       scanf( %d%d , &a[i].first, &a[i].second);       b[i] = a[i].first + a[i].second;     }     sort(a, a + n);     sort(b, b + n);     int res = 1;     for (int i = 0; i < n; ++i) {       int p = lower_bound(b, b + n, a[i].first - a[i].second + 1) - b - 1;       int curVal = FindMax(p) + 1;       Update(lower_bound(b, b + n, a[i].first + a[i].second) - b, curVal);       res = max(res, curVal);     }     cout << res << endl;     return 0;   }   