#include <bits/stdc++.h>
int main() {
  int n, t, i, j, k, xi, ai, s, y;
  int x[1000], a[1000];
  scanf("%d%d", &n, &t);
  for (i = 0; i < n; i++) {
    scanf("%d%d", &xi, &ai);
    j = 0;
    while ((j < i) && (x[j] < xi)) j++;
    for (k = i; k > j; k--) {
      x[k] = x[k - 1];
      a[k] = a[k - 1];
    }
    x[j] = xi;
    a[j] = ai;
  }
  s = 2;
  for (i = 0; i < n - 1; i++) {
    y = (2 * x[i + 1]) - (2 * x[i]) - a[i] - a[i + 1];
    if (y == (2 * t))
      s++;
    else if ((2 * t) < y)
      s = s + 2;
  }
  printf("%d", s);
}
