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