#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000 * 1000 * 1000 + 7;
const long long NMAX = 1000 * 1000 + 11;
long long n, m, p, q, k;
long double d1, d2;
long long dp[3][3][2];
pair<long double, long double> a[NMAX];
pair<long double, long double> b[NMAX];
long double dist(pair<long double, long double> a,
                 pair<long double, long double> b) {
  return sqrt((long double)((a.first - b.first) * (a.first - b.first)) +
              ((a.second - b.second) * (a.second - b.second)));
}
inline long long cmp(long double a, long double b) {
  return a + 1e-9 < b ? -1 : b + 1e-9 < a ? +1 : 0;
}
bool check(pair<long double, long double> q, pair<long double, long double> b,
           pair<long double, long double> p, pair<long double, long double> a) {
  pair<long double, long double> x1, x2, y1, y2;
  for (long long i = 0; i <= 50; i++) {
    x1.first = (2 * a.first + b.first) / 3;
    x1.second = (2 * a.second + b.second) / 3;
    x2.first = (a.first + 2 * b.first) / 3;
    x2.second = (a.second + 2 * b.second) / 3;
    y1.first = (2 * p.first + q.first) / 3;
    y1.second = (2 * p.second + q.second) / 3;
    y2.first = (p.first + 2 * q.first) / 3;
    y2.second = (p.second + 2 * q.second) / 3;
    long double dx1y1 = dist(x1, y1);
    long double dx2y2 = dist(x2, y2);
    if (dx1y1 <= dx2y2)
      b = x2, q = y2;
    else
      a = x1, p = y1;
  }
  if (cmp(dist(a, p), d1) == 1) return false;
  return true;
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  cout << fixed << setprecision(20);
  cin >> d1 >> d2;
  dp[2][0][0] = 1;
  dp[2][1][0] = 1;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i].first >> a[i].second;
    cin >> b[i].first >> b[i].second;
  }
  long double prev = max((long double)100000000000000000, dist(a[1], b[1])),
              cur;
  long long ans = 0;
  long long status = 1;
  if (cmp(prev, d1) == -1 || cmp(prev, d1) == 0) {
    prev = 0;
    ans++;
  }
  for (long long i = 2; i <= n; i++) {
    prev = max(prev, dist(a[i - 1], b[i - 1]));
    bool inter = check(a[i], b[i], a[i - 1], b[i - 1]);
    if (inter and (cmp(d2, prev) == -1 || cmp(d2, prev) == 0)) {
      ans++;
      prev = 0;
    }
  }
  cout << ans << "\n";
  return 0;
}
