#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-5;
struct Point {
  double x, y;
  Point() {}
  Point(double __x, double __y) {
    x = __x;
    y = __y;
  }
  inline Point operator+(const Point &p) const {
    return Point(x + p.x, y + p.y);
  }
  inline Point operator-(const Point &p) const {
    return Point(x - p.x, y - p.y);
  }
  inline Point operator*(const double &p) const { return Point(x * p, y * p); }
  inline double sqr() { return x * x + y * y; }
  inline void read() { scanf("%lf%lf", &x, &y); }
  inline void print() { printf("(%0.5f %0.5f)", x, y); }
};
inline double dis(Point a, Point b) { return sqrt((a - b).sqr()); }
inline double calcdis(Point a1, Point a2, Point b1, Point b2, double k) {
  Point A = (a2 - a1) * k + a1, B = (b2 - b1) * k + b1;
  return dis(A, B);
}
int n;
double d1, d2;
Point la, lb, a, b;
int ans = 0;
bool flag = 1;
int main() {
  scanf("%d", &n);
  scanf("%lf%lf", &d1, &d2);
  la.read();
  lb.read();
  if (dis(la, lb) - eps <= d1) ans++, flag = 0;
  for (int i = 2; i <= n; i++) {
    a.read();
    b.read();
    bool flag1 = calcdis(la, a, lb, b, 0) > calcdis(la, a, lb, b, eps),
         flag2 = calcdis(la, a, lb, b, 1 - eps) > calcdis(la, a, lb, b, 1);
    if (flag1 && flag2) {
      double mindis = dis(a, b), maxdis = dis(la, lb);
      if (maxdis - eps > d2) flag = 1;
      if (flag && mindis - eps <= d1) ans++, flag = 0;
    } else if (flag1) {
      double l = 0, r = 1;
      while (l + eps < r) {
        double mid = (l + r) * 0.5;
        bool check =
            calcdis(la, a, lb, b, mid) > calcdis(la, a, lb, b, mid + eps);
        if (check)
          l = mid;
        else
          r = mid;
      }
      double mindis = calcdis(la, a, lb, b, l);
      if (flag && mindis - eps <= d1) ans++, flag = 0;
      if (dis(a, b) - eps > d2) flag = 1;
    } else if (flag2) {
      double l = 0, r = 1;
      while (l + eps < r) {
        double mid = (l + r) * 0.5;
        bool check =
            calcdis(la, a, lb, b, mid) > calcdis(la, a, lb, b, mid + eps);
        if (!check)
          l = mid;
        else
          r = mid;
      }
      double maxdis = calcdis(la, a, lb, b, l);
      if (maxdis - eps > d2) flag = 1;
      if (flag && dis(a, b) - eps <= d1) ans++, flag = 0;
    } else {
      double maxdis = dis(a, b);
      if (maxdis - eps > d2) flag = 1;
    }
    la = a;
    lb = b;
  }
  cout << ans;
}
