#include <bits/stdc++.h>
using namespace std;
const long long mod = 1e9 + 7;
const int N = 200005;
int n, t[8 * N];
void build(int a[], int v, int tl, int tr) {
  if (tl == tr)
    t[v] = a[tl];
  else {
    int tm = (tl + tr) / 2;
    build(a, v * 2, tl, tm);
    build(a, v * 2 + 1, tm + 1, tr);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
int mx(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (l == tl && r == tr) return t[v];
  int tm = (tl + tr) / 2;
  return max(mx(v * 2, tl, tm, l, min(r, tm)),
             mx(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r));
}
void update(int v, int tl, int tr, int pos, int new_val) {
  if (tl == tr)
    t[v] = new_val;
  else {
    int tm = (tl + tr) / 2;
    if (pos <= tm)
      update(v * 2, tl, tm, pos, new_val);
    else
      update(v * 2 + 1, tm + 1, tr, pos, new_val);
    t[v] = max(t[v * 2], t[v * 2 + 1]);
  }
}
int mas[2 * N];
pair<int, int> ms[N];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    scanf("%d %d", &x, &y);
    ms[i] = make_pair(x, y);
  }
  sort(ms, ms + n);
  for (int i = 0; i < n; ++i) {
    int x, y;
    x = ms[i].first;
    y = ms[i].second;
    mas[i + i] = x - y;
    mas[i + i + 1] = x + y;
    ms[i] = make_pair(x - y, x + y);
  }
  sort(mas, mas + 2 * n);
  for (int i = 0; i < n; ++i) {
    int x = lower_bound(mas, mas + 2 * n, ms[i].first) - mas;
    int y = lower_bound(mas, mas + 2 * n, ms[i].second) - mas;
    int cr = mx(1, 0, 2 * n - 1, 0, x);
    update(1, 0, 2 * n - 1, y, cr + 1);
  }
  cout << mx(1, 0, 2 * n - 1, 0, 2 * n - 1) << endl;
  return 0;
}
