#include <bits/stdc++.h>
using namespace std;
int n, t, a, b, ans;
pair<int, int> p[1001];
int main() {
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &a, &b);
    p[i] = make_pair(2 * a - b, 2 * a + b);
  }
  sort(p, p + n);
  b = p[0].first;
  for (int i = 0; i < n; i++) {
    if (i != 0 && p[i].first > b + 2 * t)
      ans += 2;
    else if (i == 0 || p[i].first == b + 2 * t)
      ans++;
    b = max(b, p[i].second);
  }
  printf("%d\n", ans + 1);
  return 0;
}
