#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-5;
long long llinf = 1e18 + 10;
int intinf = 1e9 + 7;
const long long mod = 1e9 + 7;
const int N = 1e3 + 10;
int n, t;
pair<int, int> p[N];
int main() {
  scanf("%d%d", &(n), &(t));
  t <<= 1;
  for (int i = 0; i < int(n); ++i) {
    int x, a;
    scanf("%d%d", &(x), &(a));
    p[i].first = 2 * x - a;
    p[i].second = 2 * x + a;
  }
  sort(p, p + n);
  int ans = 2;
  for (int i = 0; i < int(n - 1); ++i) {
    if (p[i + 1].first - p[i].second > t)
      ans += 2;
    else if (p[i + 1].first - p[i].second == t)
      ans++;
  }
  cout << ans << endl;
  return 0;
}
