#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 100;
int l[maxn], b[maxn];
int main() {
  int n, t, x, a, ans = 0;
  cin >> n >> t;
  t *= 2;
  for (int i = 0; i < n; i++) {
    cin >> x >> a;
    l[i] = 2 * x + a;
    b[i] = 2 * x - a;
  }
  sort(l, l + n);
  sort(b, b + n);
  for (int i = 0; i < n - 1; i++) {
    if (l[i] + t < b[i + 1])
      ans += 2;
    else if (l[i] + t == b[i + 1])
      ans++;
  }
  ans += 2;
  cout << ans;
  return 0;
}
