#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const double ep = 1e-6;
int AX[N], AY[N], BX[N], BY[N];
double dist(int i, int j, double c) {
  double ax = c * (AX[j] - AX[i]) + AX[i];
  double ay = c * (AY[j] - AY[i]) + AY[i];
  double bx = c * (BX[j] - BX[i]) + BX[i];
  double by = c * (BY[j] - BY[i]) + BY[i];
  return (ax - bx) * (ax - bx) + (ay - by) * (ay - by);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  double d1, d2;
  cin >> d1 >> d2;
  d1 *= d1, d2 *= d2;
  for (int i = 1; i <= n; i++) {
    cin >> AX[i] >> AY[i] >> BX[i] >> BY[i];
  }
  bool crossed = true;
  int ans = 0;
  for (int i = 2; i <= n; i++) {
    double la = 0, ra = 1;
    for (int binary = 0; binary <= 60; binary++) {
      double mid1 = la + (ra - la) / 3;
      double mid2 = ra - (ra - la) / 3;
      double dist1 = dist(i - 1, i, mid1);
      double dist2 = dist(i - 1, i, mid2);
      if (dist1 > dist2)
        la = mid1;
      else
        ra = mid2;
    }
    double in_dist = dist(i - 1, i, 0);
    double min_dist = dist(i - 1, i, la);
    if (in_dist > d2) crossed = true;
    if (crossed and min_dist - d1 < ep) {
      ans++;
      crossed = false;
    }
  }
  cout << ans << "\n";
  return 0;
}
