#include <iostream>
#include <complex>
#include <vector>
#include <algorithm>
#include <cmath>
#include <array>
using namespace std;
const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);
#define EQ(n,m) (abs((n)-(m)) < EPS)
#define X real()
#define Y imag()

typedef complex<double> P;
typedef vector<P> VP;
struct L : array<P, 2>{
    L(const P& a, const P& b){ at(0)=a; at(1)=b; }
    L(){}
};

double dot(P a, P b){
    return (conj(a)*b).X;
}
double cross(P a, P b){
    return (conj(a)*b).Y;
}
double distanceLP(const L &l, const P &p) {
    return abs(cross(l[1]-l[0], p-l[0])) /abs(l[1]-l[0]);
}
double distanceSP(const L &s, const P &p) {
    if(dot(s[1]-s[0], p-s[0]) < EPS) return abs(p-s[0]);
    if(dot(s[0]-s[1], p-s[1]) < EPS) return abs(p-s[1]);
    return distanceLP(s, p);
}

int main(){
    int n;
    cin >> n;
    vector<double> r(n);
    vector<L> p(n);
    for(int i=0; i<n; i++){
        double sx,sy,tx,ty;
        cin >> r[i] >> sx >> sy >> tx >> ty;
        p[i] = L(P(sx, sy), P(tx, ty));
    }
    bool canmove[16][16][2] = {};
    for(int i=0; i<n; i++){
        for(int j=0; j<n; j++){
            for(int d=0; d<2; d++){
                canmove[i][j][d] = (distanceSP(p[i], p[j][d]) +EPS > r[i]+r[j]);
            }
        }
    }

    vector<int> dp(1<<n, -1);
    dp[0] = 0;
    for(int i=0; i<(1<<n); i++){
        if(dp[i] == -1) continue;
        for(int j=0; j<n; j++){
            if(i>>j & 1) continue;
            bool ok = true;
            for(int k=0; k<n; k++){
                if(j == k) continue;
                if(!canmove[j][k][i>>k&1]){
                    ok = false;
                    break;
                }
            }
            if(ok){
                dp[i | 1<<j] = dp[i]+1;
            }
        }
    }
    cout << *max_element(dp.begin(), dp.end()) << endl;
    return 0;
}
