#include <bits/stdc++.h>
using namespace std;
template <typename T>
T abs(T a) {
  return a < 0 ? -a : a;
}
template <typename T>
T sqr(T a) {
  return a * a;
}
const int INF = int(1e9) + 7;
const long double EPS = 1e-9;
const long double PI = acos(-1.0);
int main() {
  int n, t;
  cin >> n >> t;
  t *= 2;
  vector<pair<int, int> > a(n);
  for (int i = 0; i < int(n); ++i) {
    cin >> a[i].first >> a[i].second;
    a[i].first *= 2, a[i].second *= 2;
  }
  sort((a).begin(), (a).end());
  vector<int> ans;
  for (int i = 0; i < int(int((a).size())); ++i) {
    int w1 = a[i].first - a[i].second / 2 - t / 2;
    int w2 = a[i].first + a[i].second / 2 + t / 2;
    ans.push_back(w1);
    ans.push_back(w2);
  }
  sort((ans).begin(), (ans).end());
  ans.erase(unique((ans).begin(), (ans).end()), ans.end());
  int sum = 0;
  for (int i = 0; i < int(int((ans).size())); ++i) {
    int x1 = ans[i] - t / 2;
    int x2 = ans[i] + t / 2;
    int add = 1;
    for (int j = 0; j < int(int((a).size())); ++j) {
      int y1 = a[j].first - a[j].second / 2;
      int y2 = a[j].first + a[j].second / 2;
      int l = max(x1, y1);
      int r = min(x2, y2);
      if (l < r) {
        add = 0;
        break;
      }
    }
    sum += add;
  }
  cout << sum << endl;
  return 0;
}
