#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10, mod = 1e9 + 7;
double dis(double x, double y, double z, double w) {
  double dis1 = z - x, dis2 = w - y;
  return sqrt(dis1 * dis1 + dis2 * dis2);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  double d1, d2;
  cin >> n >> d1 >> d2;
  double prx1, pry1, prx2, pry2, nx1, ny1, nx2, ny2;
  cin >> prx1 >> pry1 >> prx2 >> pry2;
  int ret = 0;
  bool sw = true;
  if (dis(prx1, pry1, prx2, pry2) <= d1) ret++, sw = false;
  for (int i = 0; i < n - 1; i++) {
    cin >> nx1 >> ny1 >> nx2 >> ny2;
    if (!sw) {
      if (dis(nx1, ny1, nx2, ny2) > d2) sw = true;
    } else {
      double l = 0, r = 1;
      for (int i = 0; i < 100; i++) {
        double m1 = (l * double(2) + r) / double(3);
        double m2 = (r * double(2) + l) / double(3);
        if (dis(prx1 + (nx1 - prx1) * m1, pry1 + (ny1 - pry1) * m1,
                prx2 + (nx2 - prx2) * m1, pry2 + (ny2 - pry2) * m1) <
            dis(prx1 + (nx1 - prx1) * m2, pry1 + (ny1 - pry1) * m2,
                prx2 + (nx2 - prx2) * m2, pry2 + (ny2 - pry2) * m2))
          r = m2;
        else
          l = m1;
      }
      if (dis(prx1 + (nx1 - prx1) * l, pry1 + (ny1 - pry1) * l,
              prx2 + (nx2 - prx2) * l, pry2 + (ny2 - pry2) * l) <= d1) {
        ret++;
        sw = false;
      }
      if (dis(nx1, ny1, nx2, ny2) > d2) sw = true;
    }
    prx1 = nx1;
    pry1 = ny1;
    prx2 = nx2;
    pry2 = ny2;
  }
  cout << ret;
  return 0;
}
