#include <bits/stdc++.h>
using namespace std;
double distance(pair<long long, long long> &a, pair<long long, long long> &b) {
  return sqrt((a.first - b.first) * (a.first - b.first) +
              (a.second - b.second) * (a.second - b.second));
}
double distance(pair<double, double> &a) {
  return sqrt(a.first * a.first + a.second * a.second);
}
pair<double, double> abt(pair<long long, long long> &a,
                         pair<long long, long long> &b, double t) {
  return make_pair((double)a.first + t * (double)b.first,
                   (double)a.second + t * (double)b.second);
}
signed main() {
  bool seen = false;
  long long count = 0;
  long long n, d11, d22;
  vector<vector<long long> > moments;
  cin >> n >> d11 >> d22;
  for (long long i = 0; i < n; i++) {
    long long a, b, c, d;
    cin >> a >> b >> c >> d;
    moments.push_back({a, b, c, d});
  }
  for (long long i = 0; i < n - 1; i++) {
    pair<long long, long long> a =
        make_pair(moments[i][0] - moments[i][2], moments[i][1] - moments[i][3]);
    pair<long long, long long> d1 = make_pair(
        moments[i + 1][0] - moments[i][0], moments[i + 1][1] - moments[i][1]);
    pair<long long, long long> d2 = make_pair(
        moments[i + 1][2] - moments[i][2], moments[i + 1][3] - moments[i][3]);
    pair<long long, long long> b =
        make_pair(d1.first - d2.first, d1.second - d2.second);
    double t = (double)(-1 * a.first * b.first - a.second * b.second) /
               (double)(b.first * b.first + b.second * b.second);
    if (!(t == t)) {
      t = 0;
    }
    t = max(t, (double)0);
    t = min(t, (double)1);
    pair<double, double> closest = abt(a, b, t);
    double close = distance(closest);
    pair<double, double> t2 = abt(a, b, 1);
    double end = distance(t2);
    if (close <= d11) {
      if (!seen) {
        seen = true;
        count++;
      }
    }
    if (end > d22) {
      seen = false;
    }
  }
  cout << count << endl;
  return 0;
}
