#include <bits/stdc++.h>
using namespace std;
int coord[2011];
int main() {
  int n, t, num = 0;
  cin >> n >> t;
  t *= 2;
  for (int i = 0; i < n; i++) {
    int x, a;
    cin >> x >> a;
    coord[num++] = 2 * x - a;
    coord[num++] = 2 * x + a;
  }
  sort(coord, coord + num);
  int res = 2;
  for (int i = 2; i < num; i += 2) {
    if (coord[i] - coord[i - 1] > t) res += 2;
    if (coord[i] - coord[i - 1] == t) res++;
  }
  cout << res;
  return 0;
}
