#include <bits/stdc++.h>
using namespace std;
void loadData(void);
int proc(void);
void printRes(int);
typedef struct House {
  int left, right;
} house;
int n, t;
vector<house> houses;
bool houseCmp(const house &ha, const house &hb);
int main(int argc, char **argv) {
  loadData();
  printRes(proc());
  return 0;
}
bool houseCmp(const house &ha, const house &hb) { return ha.left < hb.left; }
int proc(void) {
  sort(houses.begin(), houses.end(), houseCmp);
  vector<int> res;
  for (int i = 0; i < houses.size(); i++) {
    if (i == 0)
      res.push_back(houses[i].left - t);
    else if (houses[i].left - houses[i - 1].right >= 2 * t &&
             !binary_search(res.begin(), res.end(), houses[i].left - t))
      res.push_back(houses[i].left - t);
    if (i == houses.size() - 1)
      res.push_back(houses[i].right + t);
    else if (houses[i + 1].left - houses[i].right >= 2 * t &&
             !binary_search(res.begin(), res.end(), houses[i].right + t))
      res.push_back(houses[i].right + t);
  }
  return res.size();
}
void loadData(void) {
  scanf("%d%d", &n, &t);
  houses.clear();
  int x, a;
  for (int i = 0; i < n; i++) {
    scanf("%d%d", &x, &a);
    house newHouse;
    newHouse.left = 2 * x - a;
    newHouse.right = 2 * x + a;
    houses.push_back(newHouse);
  }
  return;
}
void printRes(int res) {
  printf("%d\n", res);
  return;
}
