#include <bits/stdc++.h>
using namespace std;
using ld = long double;
using T = pair<ld, ld>;
const ld eps = 1e-6;
ld ternary_search(T a1, T a2, T b1, T b2) {
  ld l = 0.0, r = 1.0;
  T v1 = T(a2.first - a1.first, a2.second - a1.second);
  T v2 = T(b2.first - b1.first, b2.second - b1.second);
  auto get = [&](const ld &m) -> ld {
    T p1 = T(a1.first + v1.first * m, a1.second + v1.second * m);
    T p2 = T(b1.first + v2.first * m, b1.second + v2.second * m);
    return (p2.first - p1.first) * (p2.first - p1.first) +
           (p2.second - p1.second) * (p2.second - p1.second);
  };
  for (int i = 0; i < 99; i++) {
    ld m1 = (l * 2.0 + r) / 3.0;
    ld m2 = (l + 2.0 * r) / 3.0;
    if (get(m1) > get(m2)) {
      l = m1;
    } else {
      r = m2;
    }
  }
  return get(l);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.precision(2);
  cout.setf(ios::fixed);
  int n, d[3];
  cin >> n;
  cin >> d[1] >> d[2];
  vector<T> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i].first >> a[i].second;
    cin >> b[i].first >> b[i].second;
  }
  int ans = 0;
  ld mx = 0.0;
  bool can = false, notseen = true;
  for (int i = 0; i < n - 1; i++) {
    mx = max(mx, (a[i].first - b[i].first) * (a[i].first - b[i].first) +
                     (a[i].second - b[i].second) * (a[i].second - b[i].second));
    can = can || (mx > d[2] * d[2]);
    ld mn = ternary_search(a[i], a[i + 1], b[i], b[i + 1]);
    if (notseen && mn - eps <= (ld)d[1] * (ld)d[1]) {
      ++ans;
      mx = 0.0;
      can = false;
      notseen = false;
    }
    if (can && mn - eps <= (ld)d[1] * (ld)d[1]) {
      ++ans;
      mx = 0.0;
      can = false;
    }
  }
  cout << ans << '\n';
  return 0;
}
