#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  double t;
  while (scanf("%d%lf", &n, &t) != -1) {
    int sum = 2;
    double map[2002];
    for (int i = 0; i < n; i++) {
      double a, b;
      scanf("%lf%lf", &a, &b);
      map[i * 2] = a - b / 2;
      map[i * 2 + 1] = a + b / 2;
    }
    sort(map, map + 2 * n);
    for (int i = 1; i < n; i++) {
      if (map[2 * i] - map[2 * i - 1] > t)
        sum += 2;
      else if (map[2 * i] - map[2 * i - 1] == t)
        sum++;
    }
    printf("%d\n", sum);
  }
}
