#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9;
const int maxN = 1e6;
const int mod = 1e9 + 7;
long long gcd(long long a, long long b) {
  if (a == 0) {
    return b;
  }
  return gcd(b % a, a);
}
long long int lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
long long int powerp(long long x, long long int y, int p) {
  if (x == 0 && y == 0) {
    return 1;
  }
  int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
long long int power(long long x, long long int y) {
  if (x == 0 && y == 0) {
    return 1;
  }
  if (x == 0) {
    return 0;
  }
  int res = 1;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
bool isPrime(long long int n, int k) {
  if (n <= 1 || n == 4) return false;
  if (n <= 3) return true;
  while (k > 0) {
    int a = 2 + rand() % (n - 4);
    if (gcd(n, a) != 1) return false;
    if (powerp(a, n - 1, n) != 1) return false;
    k--;
  }
  return true;
}
int phi(int n) {
  int res = n;
  for (int i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      while (n % i == 0) {
        n /= i;
      }
      res -= (res) / i;
    }
  }
  if (n > 1) {
    res -= res / n;
  }
  return res;
}
long long int binomcoef(int n, int k, int p) {
  long long int C[k + 1];
  memset(C, 0, sizeof(C));
  C[0] = 1;
  for (int i = 1; i <= n; i++) {
    for (int j = min(i, k); j > 0; j--) {
      C[j] += C[j - 1];
      C[j] %= p;
    }
  }
  return C[k];
}
long long inverse(int n, int mod) { return powerp(n, mod - 2, mod); }
int binarysearch(vector<int> a, int target) {
  int n = a.size();
  int i = 0, j = n - 1;
  while (i <= j) {
    int mid = (i + j) / 2;
    if (a[mid] > target) {
      j = mid - 1;
    } else if (a[mid] < target) {
      i = mid + 1;
    } else {
      return mid;
    }
  }
  return -1;
}
int lowerbound(vector<int> a, int target) {
  int n = a.size();
  int i = 0, j = n - 1;
  int ans = -1;
  while (i <= j) {
    int mid = (i + j) / 2;
    if (a[mid] < target) {
      i = mid + 1;
    } else if (a[mid] >= target) {
      ans = mid;
      j = mid - 1;
    }
  }
  return ans;
}
bool cmp(pair<int, int> p1, pair<int, int> p2) { return p1.first < p2.first; }
int main() {
  int n, t;
  cin >> n >> t;
  vector<int> x(n);
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> a[i];
  }
  vector<pair<double, double>> k(n);
  for (int i = 0; i < n; i++) {
    k[i].first = x[i] - (double)a[i] / (double)2;
    k[i].second = x[i] + (double)a[i] / (double)2;
  }
  sort(k.begin(), k.end(), cmp);
  int ans = 2;
  for (int i = 0; i < n - 1; i++) {
    if (k[i + 1].first - k[i].second > t) {
      ans += 2;
    } else if (k[i + 1].first - k[i].second == t) {
      ans++;
    }
  }
  cout << ans << "\n";
  return 0;
}
