#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ld = long long;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned;
using ushort = unsigned short;
using uchar = unsigned char;
const int mod = int(1e9 + 7);
const int prime = int(2e9 + 11);
const ld pi = acosl(-1);
const double eps = 1e-12;
const int dirs[4][2] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
template <typename T>
constexpr T inf() {
  return numeric_limits<T>::max() / 2;
}
struct Vec2 {
  ld x, y;
  bool operator==(const Vec2 &r) const { return x == r.x && y == r.y; }
  bool operator!=(const Vec2 &r) const { return !(*this == r); }
  bool operator<(const Vec2 &r) const { return x == r.x ? y < r.y : x < r.x; }
  bool operator<=(const Vec2 &r) const { return *this == r || *this < r; }
  bool operator>(const Vec2 &r) const { return x == r.x ? y > r.y : x > r.x; }
  bool operator>=(const Vec2 &r) const { return *this == r || *this > r; }
  Vec2 operator+(const Vec2 &r) const { return {x + r.x, y + r.y}; }
  Vec2 operator-() const { return {-x, -y}; }
  Vec2 operator-(const Vec2 &r) const { return *this + -r; }
  Vec2 operator*(ld r) const { return {x * r, y * r}; }
  ld size() const { return hypot(x, y); }
  Vec2 normalize() const { return {x / size(), y / size()}; }
  ld dot(const Vec2 &r) const { return x * r.x + y * r.y; }
  ld cross(const Vec2 &r) const { return x * r.y - y * r.x; }
  ld polar() const { return fmod(atan2(y, x) + 2 * pi, 2 * pi); }
  Vec2 project(const Vec2 &base) const {
    Vec2 b = base.normalize();
    return b * b.dot(*this);
  }
  Vec2 operator+=(const Vec2 &r) { return *this = *this + r; }
  Vec2 operator-=(const Vec2 &r) { return *this = *this - r; }
  Vec2 operator*=(ld r) { return *this = *this * r; }
} err = {inf<int>(), inf<int>()};
ld ccw(Vec2 a, Vec2 b) { return a.cross(b); }
Vec2 line_intersect(Vec2 a, Vec2 b, Vec2 c, Vec2 d) {
  ld det = (b - a).cross(d - c);
  if (abs(det) < eps) return err;
  return a + (b - a) * ((c - a).cross(d - c) / det);
}
Vec2 paral_seg(Vec2 a, Vec2 b, Vec2 c, Vec2 d) {
  if (b < a) swap(a, b);
  if (d < c) swap(c, d);
  if (ccw(b - a, c - a) != 0 || b < c || d < a) return err;
  return max(a, c);
}
bool bound_rect(Vec2 a, Vec2 b, Vec2 p) {
  if (a > b) swap(a, b);
  return a <= p && p <= b;
}
Vec2 seg_intersect(Vec2 a, Vec2 b, Vec2 c, Vec2 d) {
  auto p = line_intersect(a, b, c, d);
  if (p == err) return paral_seg(a, b, c, d);
  bool in = bound_rect(a, b, p) && bound_rect(c, d, p);
  return in ? p : err;
}
Vec2 perpendFoot(Vec2 a, Vec2 b, Vec2 p) {
  Vec2 res = a + (p - a).project(b - a);
  return bound_rect(a, b, res) ? res : err;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  cout << fixed << setprecision(10);
  srand((uint)time(0));
  int n;
  cin >> n;
  int d1, d2;
  cin >> d1 >> d2;
  int pax, pay, pbx, pby;
  cin >> pax >> pay >> pbx >> pby;
  bool can = true;
  int ans = 0;
  for (auto i = 1; i < n; ++i) {
    int ax, ay, bx, by;
    cin >> ax >> ay >> bx >> by;
    Vec2 as = {(ld)pax, (ld)pay};
    Vec2 bs = {(ld)pbx, (ld)pby};
    Vec2 ae = {(ld)ax, (ld)ay};
    Vec2 be = {(ld)bx, (ld)by};
    auto c = (as - bs).dot(as - bs);
    auto t = 2 * (as - bs).dot(ae - be - (as - bs));
    auto tsq = (ae - be - (as - bs)).dot((ae - be - (as - bs)));
    double x = !tsq ? 2 : -t / (2 * double(tsq));
    vector<double> candi;
    candi.push_back(c);
    candi.push_back(c + t * x + tsq * x * x);
    candi.push_back(c + t + tsq);
    if (x < 0 || x > 1) candi[1] = (candi[0] + candi[2]) / 2;
    for (auto i = 0; i < 3; ++i)
      if (candi[i] <= d1 * d1 && can)
        ans++, can = false;
      else if (candi[i] > d2 * d2)
        can = true;
    pax = ax;
    pay = ay;
    pbx = bx;
    pby = by;
  }
  cout << ans << '\n';
  return 0;
}
