#include <bits/stdc++.h>
using namespace std;
set<int> starts;
vector<int> options[400005];
long dp[400005];
int nxt[400005];
int ls[200002];
int rs[200002];
int ps[200002];
int readInt() {
  bool minus = false;
  int result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    minus = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (minus)
    return -result;
  else
    return result;
}
long recur(int pos) {
  if (pos == 1e9) return 0;
  if (dp[pos] != 0) return dp[pos];
  long res = recur(nxt[pos]);
  for (int i : options[pos]) {
    res = max(res, recur(nxt[rs[i]]) + ps[i]);
  }
  dp[pos] = res;
  return res;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < 400005; i++) {
    dp[i] = 0;
    nxt[i] = 0;
  }
  int n;
  n = readInt();
  set<int> times;
  for (int i = 0; i < n; i++) {
    int x = readInt();
    int sz = readInt();
    ls[i] = max(0, x - sz + 1);
    rs[i] = x + sz - 1;
    ps[i] = 1;
    times.emplace(ls[i]);
    times.emplace(rs[i]);
  }
  map<int, int> mapping;
  int size = times.size();
  for (int i = 0; i < size; i++) {
    auto it = times.lower_bound(0);
    mapping[*it] = i;
    times.erase(*it);
  }
  for (int i = 0; i < n; i++) {
    ls[i] = mapping[ls[i]];
    rs[i] = mapping[rs[i]];
  }
  for (int i = 0; i < n; i++) {
    starts.emplace(ls[i]);
    options[ls[i]].push_back(i);
  }
  starts.emplace(1e9);
  for (int i = 0; i <= size; i++) {
    nxt[i] = *starts.upper_bound(i);
  }
  long res = recur(0);
  cout << res << endl;
  return 0;
}
