#include <bits/stdc++.h>
using namespace std;
const int seed = 131;
const long long LLMAX = 2e18;
const int MOD = 1e9 + 7;
const double eps = 1e-8;
const int MAXN = 1e6 + 10;
const int hmod1 = 0x48E2DCE7;
const int hmod2 = 0x60000005;
inline long long sqr(long long x) { return x * x; }
inline int sqr(int x) { return x * x; }
inline double sqr(double x) { return x * x; }
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
long long exgcd(long long a, long long b, long long &x, long long &y) {
  long long d;
  (b == 0 ? (x = 1, y = 0, d = a)
          : (d = exgcd(b, a % b, y, x), y -= a / b * x));
  return d;
}
long long qpow(long long a, long long n) {
  long long sum = 1;
  while (n) {
    if (n & 1) sum = sum * a % MOD;
    a = a * a % MOD;
    n >>= 1;
  }
  return sum;
}
inline int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return (x > 0 ? 1 : -1);
}
pair<double, double> pa[MAXN], push_back[MAXN];
pair<double, double> operator+(pair<double, double> x, pair<double, double> y) {
  return pair<double, double>(x.first + y.first, x.second + y.second);
}
pair<double, double> operator-(pair<double, double> x, pair<double, double> y) {
  return pair<double, double>(x.first - y.first, x.second - y.second);
}
double cross(pair<double, double> x, pair<double, double> y) {
  return x.first * y.second - x.second * y.first;
}
double dis(pair<double, double> x, pair<double, double> y) {
  return sqrt(sqr(x.first - y.first) + sqr(x.second - y.second));
}
double dot(pair<double, double> x, pair<double, double> y) {
  return x.first * y.first + x.second * y.second;
}
double point_to_seg(pair<double, double> ls, pair<double, double> lt,
                    pair<double, double> p) {
  if (dcmp(dot(lt - ls, p - ls)) >= 0 && dcmp(dot(ls - lt, p - lt)) >= 0)
    return fabs(cross(lt - ls, p - ls)) / dis(ls, lt);
  else
    return min(dis(ls, p), dis(lt, p));
}
int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n, flag = 1, ans = 0;
  double d1, d2;
  cin >> n >> d1 >> d2;
  for (int i = 0; i < n; i++)
    cin >> pa[i].first >> pa[i].second >> push_back[i].first >>
        push_back[i].second;
  if (dcmp(dis(pa[0], push_back[0]) - d1) <= 0) ans++, flag = 0;
  for (int i = 1; i < n; i++) {
    double dist = dis(pa[i], push_back[i]);
    if (flag &&
        dcmp(point_to_seg(push_back[i - 1], push_back[i] - (pa[i] - pa[i - 1]),
                          pa[i - 1]) -
             d1) <= 0)
      ans++, flag = 0;
    if (dcmp(dist - d2) > 0) flag = 1;
  }
  cout << ans << endl;
  return 0;
}
