#include <bits/stdc++.h>
using namespace std;
const int maxn = (int)1e6;
const int inf = (int)1e9;
const int mod = (int)1e9 + 7;
const double eps = 1e-9;
const int magic = 100000 + 10;
int a[maxn], x[maxn], n, t, used[maxn], ans;
bool check(int pos) {
  for (int i = 0; i < n; ++i) {
    if (pos <= x[i] && pos + t > x[i] - a[i]) return false;
    if (x[i] <= pos && x[i] + a[i] > pos - t) return false;
  }
  return true;
}
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; ++i) {
    scanf("%d%d", x + i, a + i);
    x[i] *= 2;
  }
  for (int i = 0; i < n; ++i) {
    if (!used[x[i] - a[i] - t + magic] && check(x[i] - a[i] - t)) {
      used[x[i] - a[i] - t + magic] = true;
      ++ans;
    }
    if (!used[x[i] + a[i] + t + magic] && check(x[i] + a[i] + t)) {
      used[x[i] + a[i] + t + magic] = true;
      ++ans;
    }
  }
  printf("%d\n", ans);
  return 0;
}
