#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 7;
long long d1, d2;
struct Point {
  long long x, y;
  Point() {}
  Point(long long x, long long y) : x(x), y(y) {}
} P[MX], Q[MX];
Point operator-(Point A, Point B) { return Point(A.x - B.x, A.y - B.y); }
Point operator+(Point A, Point B) { return Point(A.x + B.x, A.y + B.y); }
Point operator*(Point A, long long p) { return Point(A.x * p, A.y * p); }
bool operator==(Point A, Point B) { return (A.x == B.x && A.y == B.y); }
long long Dot(Point A, Point B) { return A.x * B.x + A.y * B.y; }
long long Cross(Point A, Point B) { return A.x * B.y - A.y * B.x; }
long long Length(Point A) { return sqrt(Dot(A, A)); }
long long Length2(Point A) { return Dot(A, A); }
bool check(int i, Point P, Point A, Point B) {
  if (A == B) return Length2(P - A) <= d1 * d1;
  Point v1 = B - A, v2 = P - A, v3 = P - B;
  if (Dot(v1, v2) < 0)
    return Length2(v2) <= d1 * d1;
  else if (Dot(v1, v3) > 0)
    return Length2(v3) <= d1 * d1;
  else
    return Cross(v1, v2) * Cross(v1, v2) <= Length2(v1) * d1 * d1;
}
int main() {
  int n;
  scanf("%d%I64d%I64d", &n, &d1, &d2);
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d %I64d %I64d", &P[i].x, &P[i].y, &Q[i].x, &Q[i].y);
  }
  bool flag = 0;
  int ans = 0;
  if (Length2(P[0] - Q[0]) <= d1 * d1) {
    ++ans;
    flag = 1;
  }
  for (int i = 1; i < n; i++) {
    bool f = check(i, P[i - 1], Q[i - 1],
                   Q[i - 1] + (Q[i] - Q[i - 1]) - (P[i] - P[i - 1]));
    if (!flag && f) ++ans;
    flag |= f;
    if (Length2(P[i] - Q[i]) > d2 * d2) flag = 0;
  }
  cout << ans << endl;
}
