#include <bits/stdc++.h>
using namespace std;
struct node {
  double l;
  double r;
} house[10005];
bool cmp(const node &x, const node &y) { return x.l < y.l; }
int main() {
  int n;
  double t;
  while (cin >> n >> t) {
    for (int i = 1; i <= n; i++) {
      double x, a;
      cin >> x >> a;
      house[i].l = x - a / 2;
      house[i].r = x + a / 2;
    }
    house[0].l = house[0].r = -0x3f3f3f3f;
    sort(house + 1, house + n + 1, cmp);
    int sol = 0;
    for (int i = 1; i <= n; i++) {
      if (house[i].l - house[i - 1].r > t) {
        sol += 2;
      } else if (house[i].l - house[i - 1].r == t) {
        sol += 1;
      }
    }
    cout << sol << endl;
  }
  return 0;
}
