#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
const double eps = 1e-9;
struct Point {
  int x, y;
} p[N], q[N];
pair<double, double> ky[N * 5];
int n, kn;
int d1, d2;
bool Onseg(double t) { return t > -eps && t < 1 + eps; }
int dcmp(double a) {
  if (fabs(a) < eps) return 0;
  return a < 0 ? -1 : 1;
}
int main() {
  scanf("%d%d%d", &n, &d1, &d2);
  for (int i = 0; i < n; ++i)
    scanf("%d%d%d%d", &p[i].x, &p[i].y, &q[i].x, &q[i].y);
  for (int i = 1; i < n; ++i) {
    double k1 = p[i].x - p[i - 1].x - q[i].x + q[i - 1].x,
           c1 = p[i - 1].x - q[i - 1].x,
           k2 = p[i].y - p[i - 1].y - q[i].y + q[i - 1].y,
           c2 = p[i - 1].y - q[i - 1].y;
    double a = k1 * k1 + k2 * k2, b = 2 * (k1 * c1 + k2 * c2),
           c = c1 * c1 + c2 * c2;
    double delta = b * b - 4 * a * (c - 1.0 * d1 * d1);
    if (dcmp(a) != 0) {
      double t1 = (-b - sqrt(delta)) / 2 / a, t2 = (-b + sqrt(delta)) / 2 / a;
      if (Onseg(t1)) ky[kn++] = make_pair(t1 + i - 1, d1);
      if (Onseg(t2)) ky[kn++] = make_pair(t2 + i - 1, d1);
      if (Onseg(-b / (2 * a))) {
        double x = -b / (2 * a);
        ky[kn++] = make_pair(x + i - 1, sqrt(a * x * x + b * x + c));
      }
    }
    ky[kn++] = make_pair(i - 1.0, sqrt(c));
    ky[kn++] = make_pair(1.0 * i, sqrt(a + b + c));
  }
  sort(ky, ky + kn);
  int ans = 0;
  {
    int i = 0;
    while (dcmp(ky[i].second - d1) == 1 && i < kn) ++i;
    if (i < kn) ++ans;
    for (int j = i + 1; j < kn; ++j) {
      double mx = 0;
      for (j = i + 1; dcmp(ky[j].second - d1) != 0 && j < kn; ++j)
        mx = max(mx, ky[j].second);
      if (j == kn) break;
      i = j;
      if (mx > eps + 1.0 * d2) ++ans;
    }
  }
  printf("%d\n", ans);
  return 0;
}
