#include <bits/stdc++.h>
using namespace std;
const int MAX = 1000;
pair<int, int> a[MAX];
int n, t;
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a, a + n);
  int cnt = 0;
  for (int i = 1; i < n; i++) {
    int c = a[i].first * 2 - a[i].second - a[i - 1].first * 2 - a[i - 1].second;
    if (c == 2 * t)
      cnt++;
    else if (c > 2 * t)
      cnt += 2;
  }
  printf("%d\n", cnt + 2);
  return 0;
}
