#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N = 2e5 + 5;
int n, sg[8 * N];
pair<int, int> a[N];
unordered_map<int, int> mp;
void update(int node, int l, int r, int pt, int x) {
  if (pt > r || pt < l) return;
  if (l == r) {
    sg[node] = x;
    return;
  }
  int mid = (l + r) / 2;
  update(2 * node, l, mid, pt, x);
  update(2 * node + 1, mid + 1, r, pt, x);
  sg[node] = max(sg[2 * node], sg[2 * node + 1]);
}
int que(int node, int l, int r, int le, int re) {
  if (le > r || re < l) return 0;
  if (l >= le && r <= re) {
    return sg[node];
  }
  int mid = (l + r) / 2;
  int q1 = que(2 * node, l, mid, le, re);
  int q2 = que(2 * node + 1, mid + 1, r, le, re);
  return max(q1, q2);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  set<int> s;
  for (int i = 0; i < n; i++) {
    int x, y;
    cin >> x >> y;
    a[i] = make_pair(x + y, x - y);
    s.insert(x + y);
    s.insert(x - y);
  }
  int c = 0;
  for (int x : s) {
    mp[x] = c++;
  }
  sort(a, a + n);
  int ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    int now = que(1, 0, c - 1, mp[a[i].first], c - 1) + 1;
    if (now > que(1, 0, c - 1, mp[a[i].second], mp[a[i].second])) {
      update(1, 0, c - 1, mp[a[i].second], now);
    }
  }
  cout << que(1, 0, c - 1, 0, c - 1);
  return 0;
}
