#include <bits/stdc++.h>
using namespace std;
const int mn = 1005;
int n, t;
pair<int, int> inp[mn];
int main() {
  n = ({
    int t;
    scanf("%d", &t);
    t;
  }),
  t = ({
    int t;
    scanf("%d", &t);
    t;
  });
  for (int i = 0; i < n; i++)
    inp[i].first = 2 * ({
                     int t;
                     scanf("%d", &t);
                     t;
                   }),
    inp[i].second = ({
      int t;
      scanf("%d", &t);
      t;
    });
  inp[n] = pair<int, int>(-2 * (int)1e8, 0);
  inp[n + 1] = pair<int, int>(2 * (int)1e8, 0);
  n += 2;
  sort(inp, inp + n);
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    int p1 = inp[i].first + inp[i].second + t;
    int p2 = inp[i + 1].first - inp[i + 1].second - t;
    if (p2 > p1) ans += 2;
    if (p2 == p1) ans++;
  }
  cout << ans - 2 << endl;
  ({
    int t;
    scanf("%d", &t);
    t;
  });
  return 0;
}
