#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
int v[N];
void f(int a, int b, int j) {
  for (int i = a; i < b; ++i) v[i] = j;
}
int main(void) {
  vector<int> vec;
  int n, t;
  cin >> n >> t;
  int x, a;
  for (int i = 0; i != n; ++i) {
    cin >> x >> a;
    f(x * 10 - a * 5 + 16000, x * 10 + a * 5 + 16000, i + 1);
  }
  t *= 10;
  int k = 0;
  for (int i = N - 1; i >= 0; --i) {
    if (v[i] > 0) {
      vec.push_back(-k);
      k = 0;
      continue;
    }
    v[i] = --k;
  }
  int res = 0;
  for (int i = 0; i < vec.size(); ++i) {
    if (i == 0 && vec[i] > t) {
      ++res;
      continue;
    }
    if (vec[i] > t)
      res += 2;
    else if (vec[i] == t)
      ++res;
  }
  cout << res + 1 << endl;
  return 0;
}
