#include <bits/stdc++.h>
int ax[100010], ay[100010], bx[100010], by[100010];
int n, d1, d2, ans;
int sqr(int x) { return x * x; }
double get(int x1, int x2, int Y1, int y2) {
  double A = sqr(x2) + sqr(y2);
  double B = 2. * x1 * x2 + 2. * Y1 * y2;
  double C = sqr(x1) + sqr(Y1);
  if (A == 0 || (-B / 2. / A < 0) || (-B / 2. / A > 1))
    return -1;
  else
    return (4. * A * C - B * B) / 4. / A;
}
int main() {
  scanf("%d%d%d", &n, &d1, &d2);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d%d", ax + i, ay + i, bx + i, by + i);
  ax[0] = ax[1], bx[0] = bx[1];
  ay[0] = (ay[1] > by[1]) * 1000;
  by[0] = 1000 - ay[0];
  for (int i = 1, far = 1; i <= n; i++) {
    double len1 = sqr(ax[i - 1] - bx[i - 1]) + sqr(ay[i - 1] - by[i - 1]);
    double mid =
        get(ax[i - 1] - bx[i - 1], ax[i] - bx[i] - ax[i - 1] + bx[i - 1],
            ay[i - 1] - by[i - 1], ay[i] - by[i] - ay[i - 1] + by[i - 1]);
    double len2 = sqr(ax[i] - bx[i]) + sqr(ay[i] - by[i]);
    if (mid < 0) mid = std::min(len1, len2);
    if (len1 >= d2 * d2) far = 1;
    if (far && mid <= d1 * d1) ans++, far = 0;
    if (len2 >= d2 * d2) far = 1;
  }
  printf("%d\n", ans);
}
