#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, a, b, d, S = 2, i = 1;
  cin >> n >> t, t *= 2;
  vector<vector<int>> xs;
  for (; cin >> a >> b; xs.push_back({2 * a - b, 2 * a + b}))
    ;
  sort(xs.begin(), xs.end());
  for (; i < n; ++i) S += (d = xs[i][0] - xs[i - 1][1]) > t ? 2 : d == t;
  cout << S;
}
