#include <bits/stdc++.h>
using namespace std;
int n, t, res = 2;
pair<int, int> a[1002];
int main() {
  cin >> n >> t;
  for (int i = 0; i < n; ++i) scanf("%d%d", &a[i].first, &a[i].second);
  sort(a, a + n);
  for (int i = 0; i < n - 1; ++i) {
    double b1 = a[i].first + (double)a[i].second / 2.0;
    double b2 = a[i + 1].first - (double)a[i + 1].second / 2.0;
    if (b2 - b1 == t) ++res;
    if (b2 - b1 > t) res += 2;
  }
  cout << res;
  return 0;
}
