#include <bits/stdc++.h>
using namespace std;
int n;
pair<int, int> p[200005];
int r[400005];
vector<int> ev[400005];
template <class T>
inline void makemax(T &first, T second) {
  if (first < second) first = second;
}
int main() {
  cin >> n;
  for (int i = (int)(0); i < (int)(n); ++i) {
    int first, second;
    scanf("%d%d", &first, &second);
    p[i] = {first - second, first + second};
  }
  vector<int> V = {-1};
  for (int i = (int)(0); i < (int)(n); ++i)
    V.push_back(p[i].first), V.push_back(p[i].second);
  sort(V.begin(), V.end());
  auto tmp = unique(V.begin(), V.end()) - V.begin();
  while (V.size() > tmp) V.pop_back();
  for (int i = (int)(0); i < (int)(n); ++i)
    p[i].first = lower_bound(V.begin(), V.end(), p[i].first) - V.begin(),
    p[i].second = lower_bound(V.begin(), V.end(), p[i].second) - V.begin();
  for (int i = (int)(0); i < (int)(n); ++i) ev[p[i].second].push_back(i);
  for (int i = (int)(1); i < (int)(400005); ++i) {
    r[i] = r[i - 1];
    for (auto first : ev[i]) makemax(r[i], 1 + r[p[first].first]);
  }
  cout << r[400004] << endl;
  return 0;
}
