#include <bits/stdc++.h>
using namespace std;
int n, t, cn, a[2000 + 5];
int main() {
  int T, i, j, k;
  while (~scanf("%d %d", &n, &t)) {
    for (i = 0; i < n; i++) {
      scanf("%d %d", &j, &k);
      a[i * 2] = j * 2 + k;
      a[i * 2 + 1] = j * 2 - k;
    }
    sort(a, a + 2 * n);
    n *= 2;
    t *= 2;
    cn = 2;
    for (i = 1; i < n; i += 2) {
      if (a[i + 1] - a[i] > t)
        cn += 2;
      else if (a[i + 1] - a[i] == t)
        cn++;
    }
    printf("%d\n", cn);
  }
  return 0;
}
