#include <bits/stdc++.h>
using namespace std;
double ABS(double a) {
  if (a < 0)
    return -a;
  else
    return a;
}
bool cmp(double a, double b) { return ABS(a - b) <= 1e-4; }
double dis(pair<double, double> a, pair<double, double> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
double cal(double k, pair<double, double> a, pair<double, double> b,
           pair<double, double> A, pair<double, double> B) {
  pair<double, double> va = make_pair(A.first - a.first, A.second - a.second),
                       vb = make_pair(B.first - b.first, B.second - b.second);
  va.first *= k;
  va.second *= k;
  vb.first *= k;
  vb.second *= k;
  a.first += va.first;
  a.second += va.second;
  b.first += vb.first;
  b.second += vb.second;
  return dis(a, b);
}
int main() {
  int n;
  double d1, d2;
  bool check = true;
  scanf("%d%lf%lf", &n, &d1, &d2);
  d1 *= d1;
  d2 *= d2;
  pair<double, double> a, b;
  scanf("%lf%lf%lf%lf", &a.first, &a.second, &b.first, &b.second);
  int res = 0;
  if (dis(a, b) < d1 || cmp(dis(a, b), d1)) {
    res++;
    check = false;
  }
  for (int i = 2; i <= n; i++) {
    pair<double, double> A, B;
    scanf("%lf%lf%lf%lf", &A.first, &A.second, &B.first, &B.second);
    if (dis(a, b) > d2) check = true;
    if (!(dis(a, b) < d1 || cmp(dis(a, b), d1))) {
      double l = 0, r = 1, tmp = d2 + 1;
      while (l < r || cmp(l, r)) {
        double m = (l + r) / 2.0;
        double xl = cal(m - 0.0001, a, b, A, B),
               xr = cal(m + 0.0001, a, b, A, B), xm = cal(m, a, b, A, B);
        if ((xl > xm && xm < xr) || (xm < d1 || cmp(xm, d1))) {
          tmp = xm;
          break;
        } else if (xl > xm && xm > xr)
          l = m + 0.0001;
        else if (xl < xm && xm < xr)
          r = m - 0.0001;
      }
      if (check && (tmp < d1 || cmp(tmp, d1))) {
        res++;
        check = false;
      }
    }
    a = A;
    b = B;
  }
  printf("%d", res);
  return 0;
}
