#include <bits/stdc++.h>
using namespace std;
int n, t, ans;
pair<int, int> rect[1000];
vector<pair<int, int>> v;
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; i++) cin >> rect[i].first >> rect[i].second;
  for (int i = 0; i < n; i++)
    v.push_back({2 * rect[i].first - rect[i].second,
                 2 * rect[i].first + rect[i].second});
  sort(v.begin(), v.end());
  t *= 2;
  for (int i = 1; i < v.size(); i++) {
    if (v[i].first - v[i - 1].second > t)
      ans += 2;
    else if (v[i].first - v[i - 1].second == t)
      ans++;
  }
  cout << ans + 2 << endl;
}
