#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t;
  scanf("%d %d", &n, &t);
  vector<pair<int, int> > h;
  for (int i = 0; i < (int)n; i++) {
    int x, a;
    scanf("%d %d", &x, &a);
    h.push_back(make_pair(x, a));
  }
  sort(h.begin(), h.end());
  int res = 2;
  for (int j = 0; j < (int)((int)(h.size())) - 1; j++) {
    pair<int, int> t1 = h[j];
    pair<int, int> t2 = h[j + 1];
    double dist = (t2.first - t1.first) - (t1.second + t2.second) / (2.);
    if (dist > t)
      res += 2;
    else if (dist == t)
      res++;
  }
  printf("%d\n", res);
}
