#include <bits/stdc++.h>
using namespace std;
double eps = 1e-5;
struct node {
  double s, t;
  bool operator<(const node &b) const { return s < b.s; }
} nod[10001];
int main() {
  int i, j, n, t, a, b;
  scanf("%d%d", &n, &t);
  int ans = 0;
  double r = -5000;
  for (i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    nod[i].s = a - b / 2.0;
    nod[i].t = a + b / 2.0;
    if (a - b / 2.0 - r > t + eps)
      ans += 2;
    else if (fabs(a - b / 2.0 - r - t) < eps)
      ans++;
    r = a + b / 2.0;
  }
  sort(nod, nod + n);
  ans = 2;
  for (i = 1; i < n; i++) {
    double tmp = nod[i].s - nod[i - 1].t;
    if (tmp > t + eps)
      ans += 2;
    else if (fabs(tmp - t) < eps)
      ans++;
  }
  printf("%d\n", ans);
  return 0;
}
