#include <bits/stdc++.h>
using namespace std;
pair<int, int> hs[1010];
int main() {
  int N, T;
  scanf("%d %d", &N, &T);
  for (int i = 0; i < N; i++) {
    scanf("%d %d", &hs[i].first, &hs[i].second);
  }
  sort(hs, hs + N);
  int res = 2;
  for (int i = 0; i < N - 1; i++) {
    int num =
        2 * hs[i + 1].first - hs[i + 1].second - 2 * hs[i].first - hs[i].second;
    if (num > 2 * T)
      res += 2;
    else if (num == 2 * T)
      res++;
  }
  printf("%d\n", res);
  return 0;
}
