#include <bits/stdc++.h>
using namespace std;
int n, d1, d2;
float prx1, pry1, prx2, pry2;
float trx1, try1, trx2, try2;
int broj;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n >> d1 >> d2;
  cin >> prx1 >> pry1 >> prx2 >> pry2;
  bool moze = true;
  broj = 0;
  for (int i = 1; i < n; ++i) {
    cin >> trx1 >> try1 >> trx2 >> try2;
    float dltx1 = (trx1 - prx1) / 2155.0, dlty1 = (try1 - pry1) / 2155.0,
          dltx2 = (trx2 - prx2) / 2155.0, dlty2 = (try2 - pry2) / 2155.0;
    for (float j = 0.0; j < 2155.0; ++j) {
      float dist = (prx1 + j * dltx1 - prx2 - j * dltx2) *
                       (prx1 + j * dltx1 - prx2 - j * dltx2) +
                   (pry1 + j * dlty1 - pry2 - j * dlty2) *
                       (pry1 + j * dlty1 - pry2 - j * dlty2);
      if (dist - d1 * d1 <= 0.0011 && moze) {
        ++broj;
        moze = false;
      }
      if (d2 * d2 - dist <= 0.0011) moze = true;
    }
    prx1 = trx1, pry1 = try1, prx2 = trx2, pry2 = try2;
  }
  cout << broj;
  return 0;
}
