#include <bits/stdc++.h>
using namespace std;
const double eps(1.0e-10);
const double mpi(acos(-1.0));
int main() {
  int n;
  double t;
  cin >> n >> t;
  vector<pair<int, int> > houses(n);
  for (int i = (int)(0); i < (int)(n); i++) {
    cin >> houses[i].first >> houses[i].second;
  }
  sort((houses).begin(), (houses).end());
  int ans(2);
  for (int i = (int)(0); i < (int)(n - 1); i++) {
    int dist = houses[i + 1].first - houses[i].first;
    double margin = (houses[i].second + houses[i + 1].second) * 0.5;
    if (dist - margin > t + eps) {
      ans += 2;
    } else if (dist - margin > t - eps) {
      ans += 1;
    }
  }
  cout << ans << endl;
  return 0;
}
