#include <bits/stdc++.h>
using namespace std;
const int M = 1100;
pair<int, int> h[M];
int main() {
  int n, t;
  scanf("%d%d", &n, &t);
  for (int i = 0; i < n; i++) {
    int a, b;
    scanf("%d%d", &a, &b);
    h[i] = pair<int, int>(a, b);
  }
  sort(h, h + n);
  long long ans = 2;
  for (int i = 0; i < n - 1; i++) {
    double xs = (double)h[i].first + (double)h[i].second / 2.0;
    double xe = (double)h[i + 1].first - (double)h[i + 1].second / 2.0;
    if ((xe - xs) > t) {
      ans += 2;
    } else if ((xe - xs) == t) {
      ans++;
    }
  }
  printf("%lld\n", ans);
}
