#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  t = 1;
  while (t--) {
    double n, m;
    cin >> n >> m;
    vector<pair<double, double>> v(n);
    for (long long int i = 0; i < n; i += 1) {
      double x, y;
      cin >> x >> y;
      v[i].first = (int)x;
      v[i].second = y / 2;
    }
    sort(v.begin(), v.end());
    long long int cnt = 0;
    for (long long int i = 1; i < n; i += 1) {
      if ((v[i].first - v[i - 1].first - v[i].second - v[i - 1].second) > m) {
        cnt += 2;
      } else if ((v[i].first - v[i - 1].first - v[i].second -
                  v[i - 1].second) == m) {
        cnt += 1;
      }
    }
    cnt += 2;
    cout << cnt;
  }
  return 0;
}
