#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 5;
const int maxt = 10 + 2;
const int maxy = 5;
int n, t[maxn], X[maxn];
int T;
int ans = 0;
inline bool is_ok(double ox) {
  bool flag = false;
  double l = ox - ((double)T / 2);
  double r = ox + ((double)T / 2);
  for (int i = 1; i <= n; ++i) {
    double l_ = (double)X[i] - ((double)t[i] / 2);
    double r_ = (double)X[i] + ((double)t[i] / 2);
    if (r_ == l || r == l_) flag = true;
    if (r_ >= r && l_ < r)
      return false;
    else if (r_ > l && r_ <= r)
      return false;
  }
  return flag;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> T;
  for (int i = 1; i <= n; ++i) cin >> X[i] >> t[i];
  for (double i = -10000; i <= 10000; i += 0.5)
    if (is_ok(i)) ans++;
  cout << ans << endl;
  return 0;
}
