#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const double eps = 1e-8;
int read() {
  int s = 0;
  char c = getchar(), lc = '+';
  while (c < '0' || '9' < c) lc = c, c = getchar();
  while ('0' <= c && c <= '9') s = s * 10 + c - '0', c = getchar();
  return lc == '-' ? -s : s;
}
void write(int x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10)
    putchar(x + '0');
  else
    write(x / 10), putchar(x % 10 + '0');
}
void print(int x = -1, char c = '\n') {
  write(x);
  putchar(c);
}
double dis(double qwertyuiop, double zxcvbnm, double asdfghjkl, double _) {
  return sqrt((qwertyuiop - asdfghjkl) * (qwertyuiop - asdfghjkl) +
              (zxcvbnm - _) * (zxcvbnm - _));
}
double qwertyuiop[N], asdfghjkl[N], zxcvbnm[N], _[N];
struct point {
  double x, y;
} a[N * 2], b[N * 2];
double calc(int i, double k) {
  double Ax = (qwertyuiop[i] - qwertyuiop[i - 1]) * k + qwertyuiop[i - 1];
  double Ay = (zxcvbnm[i] - zxcvbnm[i - 1]) * k + zxcvbnm[i - 1];
  double Bx = (asdfghjkl[i] - asdfghjkl[i - 1]) * k + asdfghjkl[i - 1];
  double By = (_[i] - _[i - 1]) * k + _[i - 1];
  return dis(Ax, Ay, Bx, By);
}
signed main(signed Recall, char *_902_[]) {
  (void)Recall, (void)_902_;
  int n = read(), d1 = read(), d2 = read(), cnt = 0;
  for (int i = 1; i <= n; i++) {
    qwertyuiop[i] = read();
    zxcvbnm[i] = read();
    asdfghjkl[i] = read();
    _[i] = read();
    if (i > 1) {
      double l = 0, r = 1;
      for (int t = 1; t <= 100; t++) {
        double mid1 = (l + r) / 2, mid2 = min(mid1 + eps, r);
        if (calc(i, mid1) < calc(i, mid2))
          r = mid2;
        else
          l = mid1;
      }
      double Ax = (qwertyuiop[i] - qwertyuiop[i - 1]) * l + qwertyuiop[i - 1];
      double Ay = (zxcvbnm[i] - zxcvbnm[i - 1]) * l + zxcvbnm[i - 1];
      double Bx = (asdfghjkl[i] - asdfghjkl[i - 1]) * l + asdfghjkl[i - 1];
      double By = (_[i] - _[i - 1]) * l + _[i - 1];
      a[++cnt] = (point){Ax, Ay};
      b[cnt] = (point){Bx, By};
    }
    a[++cnt] = (point){qwertyuiop[i], zxcvbnm[i]};
    b[cnt] = (point){asdfghjkl[i], _[i]};
  }
  int ans = 0;
  bool flag = 0;
  for (int i = 1; i <= cnt; i++)
    if (dis(a[i].x, a[i].y, b[i].x, b[i].y) <= d1 + eps) {
      if (ans == 0 || flag) ans++, flag = 0;
    } else if (dis(a[i].x, a[i].y, b[i].x, b[i].y) > d2 - eps)
      flag = 1;
  print(ans);
  return 0;
}
