#include <bits/stdc++.h>
using namespace std;
const int N = 2e4 + 50;
const long long M = 1e9;
const long long oo = 1e18;
const int mod = 1e9 + 7;
int n, d1, d2;
double dis(double x1, double y1, double x2, double y2) {
  return sqrt(((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2)));
}
pair<double, double> newPoint(int x1, int y1, int x2, int y2, double p) {
  pair<double, double> ret;
  p /= 1e9;
  if (x2 > x1)
    ret.first = x1 + (((x2 - x1)) * p);
  else
    ret.first = x1 - (((x1 - x2)) * p);
  if (y2 > y1)
    ret.second = y1 + (((y2 - y1)) * p);
  else
    ret.second = y1 - (((y1 - y2)) * p);
  return ret;
}
int main() {
  int lx1, ly1, lx2, ly2;
  cin >> n >> d1 >> d2 >> lx1 >> ly1 >> lx2 >> ly2;
  bool h = 1;
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    if (ceil(dis(lx1, ly1, lx2, ly2)) > d2) h = 1;
    double md1, md2, lo = 0, hi = 1e9, nearst = 1e9;
    for (int it = 0; it <= 100; it++) {
      md1 = lo + (hi - lo) / 3;
      md2 = hi - (hi - lo) / 3;
      pair<double, double> p1 = newPoint(lx1, ly1, x1, y1, md1);
      pair<double, double> p2 = newPoint(lx2, ly2, x2, y2, md1);
      pair<double, double> p3 = newPoint(lx1, ly1, x1, y1, md2);
      pair<double, double> p4 = newPoint(lx2, ly2, x2, y2, md2);
      double dis1 = dis(p1.first, p1.second, p2.first, p2.second);
      double dis2 = dis(p3.first, p3.second, p4.first, p4.second);
      nearst = min(nearst, min(dis1, dis2));
      if (dis1 < dis2) {
        hi = md2;
      } else {
        lo = md1;
      }
    }
    int q = ceil(nearst);
    if (q <= d1 && h) {
      ans++;
      h = 0;
    }
    q = ceil(dis(x1, y1, x2, y2));
    if (q > d2) h = 1;
    lx1 = x1;
    ly1 = y1;
    lx2 = x2;
    ly2 = y2;
  }
  cout << ans << endl;
}
