#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, t, i, j, tx, ta, x[1001], a[1001], cnt = 2;
  ;
  cin >> n >> t;
  for (i = 0; i < n; i++) {
    cin >> tx >> ta;
    for (j = i - 1; j >= 0; j--) {
      if (tx >= x[j]) break;
      x[j + 1] = x[j];
      a[j + 1] = a[j];
    }
    x[j + 1] = tx;
    a[j + 1] = ta;
  }
  for (i = 0; i < n - 1; i++) {
    if ((a[i + 1] + a[i]) % 2 == 0) {
      if ((x[i + 1] - x[i]) - (a[i + 1] + a[i]) / 2 > t)
        cnt += 2;
      else if ((x[i + 1] - x[i]) - (a[i + 1] + a[i]) / 2 == t)
        cnt++;
    } else if (((x[i + 1] - x[i]) - (a[i + 1] + a[i]) / 2) > t)
      cnt += 2;
  }
  cout << cnt;
}
