#include <bits/stdc++.h>
using namespace std;
void bubbleSort(double arr[], double arr1[], int n) {
  bool swapped = true;
  int j = 0;
  double tmp;
  while (swapped) {
    swapped = false;
    j++;
    for (int i = 0; i < n - j; i++) {
      if (arr[i] > arr[i + 1]) {
        tmp = arr[i];
        arr[i] = arr[i + 1];
        arr[i + 1] = tmp;
        tmp = arr1[i];
        arr1[i] = arr1[i + 1];
        arr1[i + 1] = tmp;
        swapped = true;
      }
    }
  }
}
int main() {
  int n, t;
  double arr[1000];
  double arr1[1000];
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> arr[i] >> arr1[i];
  }
  bubbleSort(arr, arr1, n);
  int count = 2;
  for (int i = 0; i < n - 1; i++) {
    if (-((arr[i] + arr1[i] / 2.0) - (arr[i + 1] - arr1[i + 1] / 2.0)) > t) {
      count = count + 2;
    } else if (-((arr[i] + arr1[i] / 2.0) - (arr[i + 1] - arr1[i + 1] / 2.0)) ==
               t) {
      count = count + 1;
    }
  }
  cout << count;
}
