#include <bits/stdc++.h>
using namespace std;
double sq(double x) { return x * x; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  int d1, d2;
  cin >> N;
  cin >> d1 >> d2;
  double ax, ay, bx, by, cx, cy, dx, dy;
  double t_min, distA, distB, min_dist;
  int counter = 0;
  bool isApart = true;
  bool isClose = false;
  cin >> ax >> ay >> bx >> by;
  for (int i = 1; i < N; i++) {
    cin >> cx >> cy >> dx >> dy;
    if ((bx - ax - dx + cx) != 0 or (by - ay - dy + cy) != 0) {
      t_min = -1 * (ax - bx) * (cx - ax - dx + bx) -
              (ay - by) * (cy - ay - dy + by);
      t_min = t_min / (sq(cx - ax - dx + bx) + sq(cy - ay - dy + by));
      min_dist = sqrt(sq(ax - bx + t_min * (cx - ax - dx + bx)) +
                      sq(ay - by + t_min * (cy - ay - dy + by)));
    }
    distA = sqrt(sq(ax - bx) + sq(ay - by));
    distB = sqrt(sq(cx - dx) + sq(cy - dy));
    if ((bx - ax - dx + cx) == 0 and (by - ay - dy + cy) == 0) {
      if (i == 1) {
        if (distA < d1 || distB < d1) {
          isApart = false;
          isClose = true;
          counter++;
        }
        if (distB > d2) {
          isApart = true;
          isClose = false;
        }
      }
    } else if (t_min >= 0 and t_min <= 1) {
      if (isApart) {
        if (min_dist <= d1) {
          isApart = false;
          isClose = true;
          counter++;
        }
      }
      if (distB > d2) {
        isApart = true;
        isClose = false;
      }
    } else {
      if (isApart) {
        if (i == 1 and distA <= d1) {
          isApart = false;
          isClose = true;
          counter++;
        } else if (distB <= d1) {
          isApart = false;
          isClose = true;
          counter++;
        }
      } else if (isClose) {
        if (distB > d2) {
          isApart = true;
          isClose = false;
        }
      }
    }
    ax = cx;
    ay = cy;
    bx = dx;
    by = dy;
  }
  cout << counter << endl;
  return 0;
}
