#include <bits/stdc++.h>
using namespace std;
template <class T>
ostream& operator<<(ostream& os, vector<T> V) {
  for (auto v : V) os << v << " ";
  return cout << "";
}
template <class T>
ostream& operator<<(ostream& os, set<T> S) {
  for (auto s : S) os << s << " ";
  return cout << "";
}
template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> P) {
  return os << P.first << " " << P.second;
}
const long long mod = 1000000007;
const double pi = 3.14159265358979323;
long long inv(long long i) {
  if (i == 1) return 1;
  return (mod - ((mod / i) * inv(mod % i)) % mod) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long pwr(long long a, long long b) {
  a %= mod;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
long long lcm(long long f1, long long f2) { return (f1 * f2) / gcd(f1, f2); }
const int N = 100000 + 10;
int n;
double d1, d2;
double ax[N], ay[N], bx[N], by[N];
vector<double> d;
double dist(int i, int j) {
  return sqrt((ay[i] - by[j]) * (ay[i] - by[j]) +
              (ax[i] - bx[j]) * (ax[i] - bx[j]));
}
const double eps = 1e-8;
int dblcmp(double d) {
  if (fabs(d) < eps) return 0;
  return d > eps ? 1 : -1;
}
double value(double v, long long i) {
  double temp1 = ax[i];
  double temp2 = ay[i];
  double temp3 = bx[i];
  double temp4 = by[i];
  ax[i] += (ax[i + 1] - ax[i]) * v;
  ay[i] += (ay[i + 1] - ay[i]) * v;
  bx[i] += (bx[i + 1] - bx[i]) * v;
  by[i] += (by[i + 1] - by[i]) * v;
  double ret = dist(i, i);
  ax[i] = temp1;
  ay[i] = temp2;
  bx[i] = temp3;
  by[i] = temp4;
  return ret;
}
int main() {
  long long i, j, k, n, m, f1, f2, f, t, ans, contact;
  cin >> n >> d1 >> d2;
  for (i = 1; i <= n; i++) {
    cin >> ax[i] >> ay[i] >> bx[i] >> by[i];
  }
  for (i = 1; i <= n - 1; i++) {
    d.push_back(dist(i, i));
    double l1 = 0, l2 = 1.0;
    t = 50;
    while (t--) {
      double v1 = (l1 + l1 + l2) / double(3);
      double v2 = (l1 + l2 + l2) / double(3);
      if (value(v1, i) < value(v2, i)) {
        l2 = v2;
      } else {
        l1 = v1;
      }
    }
    double temp = min(value(l1, i), value(l2, i));
    if (dblcmp(temp - dist(i, i)) or dblcmp(temp - dist(i + 1, i + 1))) {
      d.push_back(temp);
    }
  }
  d.push_back(dist(n - 1, n - 1));
  contact = 1;
  ans = 0;
  for (i = 0; i <= d.size() - 1; i++) {
    if (d[i] <= d1 + eps) {
      if (contact) {
        ans++;
        contact = 0;
      }
    }
    if (d[i] > d2) {
      contact = 1;
    }
  }
  cout << ans;
}
