#include <cstdio>
#include <cstdint>
#include <cmath>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <numeric>
#include <tuple>
#include <complex>

constexpr intmax_t  operator ""_jd(unsigned long long n) { return n; }
constexpr uintmax_t operator ""_ju(unsigned long long n) { return n; }
constexpr size_t    operator ""_zu(unsigned long long n) { return n; }
// constexpr ptrdiff_t operator ""_td(unsigned long long n) { return n; }

const double EPS = 1e-8;
const double INF = 1e12;
typedef std::complex<double> P;
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}

struct L : public std::vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
};

typedef std::vector<P> G;

struct C {
  P p; double r;
  C(const P &p, double r) : p(p), r(r) { }
};

int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (std::norm(b) < std::norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectLL(const L &l, const L &m) {
  return std::abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || // non-parallel
         std::abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;   // same line
}
bool intersectLS(const L &l, const L &s) {
  return cross(l[1]-l[0], s[0]-l[0])*       // s[0] is left of l
         cross(l[1]-l[0], s[1]-l[0]) < EPS; // s[1] is right of l
}
bool intersectLP(const L &l, const P &p) {
  return std::abs(cross(l[1]-p, l[0]-p)) < EPS;
}
bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
         ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}
bool intersectSP(const L &s, const P &p) {
  return std::abs(s[0]-p)+std::abs(s[1]-p)-std::abs(s[1]-s[0]) < EPS; // triangle inequality
}

P projection(const L &l, const P &p) {
  double t = dot(p-l[0], l[0]-l[1]) / norm(l[0]-l[1]);
  return l[0] + t*(l[0]-l[1]);
}
P reflection(const L &l, const P &p) {
  return p + 2.0 * (projection(l, p) - p);
}
double distanceLP(const L &l, const P &p) {
  return std::abs(p - projection(l, p));
}
double distanceLL(const L &l, const L &m) {
  return intersectLL(l, m) ? 0 : distanceLP(l, m[0]);
}
double distanceLS(const L &l, const L &s) {
  if (intersectLS(l, s)) return 0;
  return std::min(distanceLP(l, s[0]), distanceLP(l, s[1]));
}
double distanceSP(const L &s, const P &p) {
  const P r = projection(s, p);
  if (intersectSP(s, r)) return abs(r - p);
  return std::min(abs(s[0] - p), std::abs(s[1] - p));
}

struct point {
  int r;
  std::pair<int, int> first, second;

  point() = default;
  point(point const&) = default;
  point(int r, int sx, int sy, int tx, int ty): r(r), first(sx, sy), second(tx, ty) {}
};

constexpr double eps = 1e-5;

bool ok(std::vector<point> const& z, size_t mask, size_t tg) {
  size_t n = z.size();
  int x1, y1, x2, y2;
  std::tie(x1, y1) = z[tg].first;
  std::tie(x2, y2) = z[tg].second;
  for (size_t i = 0; i < n; ++i) {
    if (i == tg) continue;
    int x0, y0;
    if (mask >> i & 1) {
      std::tie(x0, y0) = z[i].second;
    } else {
      std::tie(x0, y0) = z[i].first;
    }
    double d = distanceSP(L(P(x1, y1), P(x2, y2)), P(x0, y0));
    if (d < z[i].r + z[tg].r - eps) return false;
  }
  return true;
}

int testcase_ends() {
  size_t n;
  scanf("%zu", &n);

  std::vector<point> z(n);
  for (size_t i = 0; i < n; ++i) {
    int r, sx, sy, tx, ty;
    scanf("%d %d %d %d %d", &r, &sx, &sy, &tx, &ty);
    z[i] = point(r, sx, sy, tx, ty);
  }

  std::vector<bool> dp(1_zu << n);
  dp[0] = true;

  for (size_t i = 0; i < (1_zu << n); ++i) {
    if (!dp[i]) continue;

    for (size_t j = 0; j < n; ++j) {
      if (i >> j & 1) continue;
      size_t ni = i | 1_zu << j;
      // j 番目の点を動かすよ．間に邪魔が入ったらだめだよ．
      if (ok(z, i, j)) dp[ni] = true;
    }
  }

  int res = 0;
  for (size_t i = 0; i < (1_zu << n); ++i) {
    if (dp[i]) res = std::max(res, __builtin_popcountll(i));
  }

  printf("%d\n", res);
  return 1;
}

int main() {
  while (!testcase_ends()) {}
}

