#include <bits/stdc++.h>
using namespace std;
int a, b, x, y;
int av, bv, xv, yv;
double dist(double t) {
  double aa = t * av + a;
  double bb = t * bv + b;
  double xx = t * xv + x;
  double yy = t * yv + y;
  return (xx - aa) * (xx - aa) + (yy - bb) * (yy - bb);
}
double ternary() {
  double s = 0, e = 1;
  for (int i = 0; i < 200; ++i) {
    double l = s + (e - s) / 3;
    double r = e - (e - s) / 3;
    if (dist(r) < dist(l)) {
      s = l;
    } else
      e = r;
  }
  return dist((s + e) / 2);
}
int main() {
  int n;
  scanf("%d", &n);
  int d1, d2;
  scanf("%d %d", &d1, &d2);
  vector<pair<pair<int, int>, pair<int, int>>> vec(n);
  for (int i = 0; i < n; ++i) {
    scanf("%d %d", &vec[i].first.first, &vec[i].first.second);
    scanf("%d %d", &vec[i].second.first, &vec[i].second.second);
  }
  bool far = 1;
  int ans = 0;
  for (int i = 1; i < n; ++i) {
    a = vec[i - 1].first.first, b = vec[i - 1].first.second;
    x = vec[i - 1].second.first, y = vec[i - 1].second.second;
    av = vec[i].first.first - vec[i - 1].first.first,
    bv = vec[i].first.second - vec[i - 1].first.second;
    xv = vec[i].second.first - vec[i - 1].second.first,
    yv = vec[i].second.second - vec[i - 1].second.second;
    double d = ternary();
    if (d < (d1 * d1) + 1e-9 && far) {
      ++ans;
      far = 0;
    }
    d = hypot(vec[i].first.first - vec[i].second.first,
              vec[i].first.second - vec[i].second.second);
    if (d + 1e-9 > d2) far = 1;
  }
  printf("%d", ans);
}
