#include <bits/stdc++.h>
using namespace std;
long long dist(pair<long long, long long> A, pair<long long, long long> B) {
  return (A.first - B.first) * (A.first - B.first) +
         (A.second - B.second) * (A.second - B.second);
}
bool dogreet(pair<long long, long long> A1, pair<long long, long long> A2,
             pair<long long, long long> B1, pair<long long, long long> B2,
             long long d1) {
  long long Kx = (A2.first - A1.first) - (B2.first - B1.first);
  long long Ky = (A2.second - A1.second) - (B2.second - B1.second);
  if (Kx == Ky && !Kx) {
    return 0;
  }
  double t0 =
      (double)((A1.first - B1.first) * Kx + Ky * (A1.second - B1.second)) /
      (Kx * Kx + Ky * Ky);
  t0 *= -1;
  if (t0 < 0 || t0 > 1) {
    return (dist(A2, B2) <= d1);
  }
  double min_D =
      (t0 * Kx + (A1.first - B1.first)) * (t0 * Kx + (A1.first - B1.first)) +
      (t0 * Ky + (A1.second - B1.second)) * (t0 * Ky + (A1.second - B1.second));
  return (min_D - d1) <= 0.0000001;
}
int32_t main() {
  long long N, d1, d2, D;
  bool greet = 1;
  long long ans = 0;
  cin >> N >> d1 >> d2;
  d1 *= d1, d2 *= d2;
  pair<long long, long long> A[N], B[N];
  for (long long i = 0; i < N; ++i) {
    cin >> A[i].first >> A[i].second >> B[i].first >> B[i].second;
  }
  if (dist(A[0], B[0]) <= d1) {
    greet = 0;
    ans++;
  }
  for (long long i = 1; i < N; ++i) {
    D = dist(A[i], B[i]);
    if (!greet) {
      if (D > d2) {
        greet = 1;
      }
      continue;
    }
    if (dogreet(A[i - 1], A[i], B[i - 1], B[i], d1)) {
      greet = 0;
      ans++;
    }
    if (D > d2) greet = 1;
  }
  cout << ans << endl;
}
