#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  cin >> n >> t;
  t *= 2;
  int i;
  vector<pair<int, int> > all;
  for (i = 0; i < n; i++) {
    int temp1, temp2;
    cin >> temp1 >> temp2;
    temp1 *= 2;
    temp2 *= 2;
    all.push_back(make_pair(temp1 - temp2 / 2, temp1 + temp2 / 2));
  }
  sort(all.begin(), all.end());
  int ans = 2;
  for (i = 0; i < n - 1; i++) {
    if (all[i + 1].first - all[i].second > t) ans += 2;
    if (all[i + 1].first - all[i].second == t) ans++;
  }
  cout << ans << endl;
  return 0;
}
