#include <bits/stdc++.h>
using namespace std;
const int iinf = 1234567890;
const int linf = 1234567890987654321;
const long double eps = 1e-9;
int main() {
  int n;
  int t;
  cin >> n >> t;
  t *= 2;
  vector<pair<int, int> > coords;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    a *= 2;
    coords.push_back(make_pair(a - b, a + b));
  }
  sort(coords.begin(), coords.end());
  int ans = 2;
  for (int i = 1; i < coords.size(); i++) {
    int a = coords[i - 1].second;
    int b = coords[i].first;
    if (b - a == t) ans++;
    if (b - a > t) ans += 2;
  }
  cout << ans;
  return 0;
}
