#include <bits/stdc++.h>
using namespace std;
float medie(float x, float y) { return (x + y) / 2; }
float dis(float ax, float ay, float bx, float by) {
  return sqrt(pow(ax - bx, 2) + pow(ay - by, 2));
}
float dismax(float ax, float ay, float bx, float by, float cx, float cy,
             float dx, float dy, float mx, float my, float nx, float ny) {
  float max = 0;
  if (max < dis(ax, ay, mx, my)) {
    max = dis(ax, ay, mx, my);
  } else if (max < dis(mx, my, bx, by)) {
    max = dis(mx, my, bx, by);
  } else if (max < dis(cx, cy, nx, ny)) {
    max = dis(cx, cy, nx, ny);
  } else if (max < dis(nx, ny, dx, dy)) {
    max = dis(nx, ny, dx, dy);
  }
  return max;
}
float min(float ax, float ay, float bx, float by, float cx, float cy, float dx,
          float dy) {
  float marja;
  float mx, my, nx, ny;
  mx = medie(ax, bx);
  my = medie(ay, by);
  nx = medie(cx, dx);
  ny = medie(cy, dy);
  marja = dismax(ax, ay, bx, by, cx, cy, dx, dy, mx, my, nx, ny);
  while (marja > 0.01) {
    if (dis(ax, ay, cx, cy) < dis(bx, by, dx, dy)) {
      bx = mx;
      by = my;
      dx = nx;
      dy = ny;
      mx = medie(ax, bx);
      my = medie(ay, by);
      nx = medie(cx, dx);
      ny = medie(cy, dy);
    } else {
      ax = mx;
      ay = my;
      cx = nx;
      cy = ny;
      mx = medie(ax, bx);
      my = medie(ay, by);
      nx = medie(cx, dx);
      ny = medie(cy, dy);
    }
    marja = dismax(ax, ay, bx, by, cx, cy, dx, dy, mx, my, nx, ny);
  }
  return dis(mx, my, nx, ny);
}
int main() {
  float n, d1, d2, ax, ay, bx, by, cx, cy, dx, dy, r = 0;
  int helo = 0;
  scanf("%f %f %f %f %f %f %f", &n, &d1, &d2, &ax, &ay, &cx, &cy);
  for (int i = 0; i < n - 1; i++) {
    scanf("%f %f %f %f", &bx, &by, &dx, &dy);
    if (d2 <= dis(ax, ay, cx, cy)) {
      r = 0;
    }
    if (r == 0 && d1 >= min(ax, ay, bx, by, cx, cy, dx, dy)) {
      helo += 1;
      r = 1;
    }
    if (d2 <= dis(bx, by, dx, dy)) {
      r = 0;
    }
    ax = bx;
    ay = by;
    cx = dx;
    cy = dy;
  }
  printf("%d", helo);
  return 0;
}
