#include <bits/stdc++.h>
using namespace std;
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 100000;
struct P {
  int x, y;
  P() {}
  P(int x, int y) : x(x), y(y) {}
};
P operator-(const P &a, const P &b) { return P(a.x - b.x, a.y - b.y); }
P operator+(const P &a, const P &b) { return P(a.x + b.x, a.y + b.y); }
long long dst2(const P &d) {
  return (long long)d.x * d.x + (long long)d.y * d.y;
}
long long dst2(const P &a, const P &b) { return dst2(b - a); }
int n;
int d1, d2;
P a[MAXN], b[MAXN];
bool can(const P &before, const P &delta, int want) {
  if (dst2(before) <= want * want || dst2(before + delta) <= want * want)
    return true;
  long long A = (long long)delta.x * delta.x + (long long)delta.y * delta.y;
  long long B =
      (long long)2 * before.x * delta.x + (long long)2 * before.y * delta.y;
  long long C = (long long)before.x * before.x + (long long)before.y * before.y;
  return A > 0 && 0 <= -B && -B <= 2 * A &&
         4 * A * C - B * B <= 4 * A * want * want;
}
int solve() {
  int state = dst2(a[0], b[0]) <= d1 * d1 ? 1 : 0;
  int ret = state;
  for (int i = (1); i < (n); ++i) {
    P before = b[i - 1] - a[i - 1], after = b[i] - a[i], delta = after - before;
    if (state == 0 && can(before, delta, d1)) ++ret, state = 1;
    if (state == 1 && dst2(after) > d2 * d2) state = 0;
  }
  return ret;
}
void run() {
  scanf("%d", &n);
  scanf("%d%d", &d1, &d2);
  for (int i = (0); i < (n); ++i)
    scanf("%d%d%d%d", &a[i].x, &a[i].y, &b[i].x, &b[i].y);
  printf("%d\n", solve());
}
int main() {
  run();
  return 0;
}
