data class Point(val x: Double, val y: Double) {
    fun distanceFrom(that: Point): Double = (this - that).let{Math.sqrt(it.x * it.x + it.y * it.y)}
    operator fun minus(that: Point): Point = Point(x - that.x, y - that.y)
}
class Line(from: Point, to: Point) {
    val a: Double = to.y - from.y
    val b: Double = from.x - to.x
    val c: Double = from.y * to.x - from.x * to.y
    fun distanceFrom(point: Point): Double {
        return Math.abs(a * point.x + b * point.y + c) / Math.sqrt(a * a + b * b)
    }
}

class Edge(val from: Point, val to: Point) {
    fun distanceFrom(point: Point): Double {
        return if ((from to to) dot (from to point) >= 0 && (to to from) dot (to to point) >= 0){
            Line(from, to).distanceFrom(point)
        }else {
            Math.min(from.distanceFrom(point), to.distanceFrom(point))
        }
    }
}
data class Vector(val x: Double, val y: Double) {
    infix fun dot(that: Vector): Double = x * that.x + y * that.y
}
infix fun Point.to(that: Point): Vector = (that - this).let{Vector(it.x, it.y)}

class Circle(val center: Point, val radius: Double) {
    fun canMoveTo(point: Point, barrier: Circle): Boolean {
        return Edge(center, point).distanceFrom(barrier.center) >= radius + barrier.radius
    }
}

fun solve(coins: List<Pair<Circle, Circle>>): Int {
    val memo = IntArray(1 shl coins.size){-1}
    memo[memo.lastIndex] = 0
    fun sub(state: Int): Int {
        if (memo[state] == -1) {
            val currentPosition = coins.withIndex().map{(i, pair) -> if (state and (1 shl i) == 0) pair.first else pair.second}
            val suspects = coins.indices.filter{state and (1 shl it) == 0 && (1 until coins.size).map{i -> currentPosition[(i + it) % coins.size]}.all{c -> coins[it].first.canMoveTo(coins[it].second.center, c)}}
            memo[state] = suspects.map{sub(state or (1 shl it)) + 1}.max() ?: 0
        }
        return memo[state]
    }
    return sub(0)
}
fun main(args: Array<String>?): Unit {
    val n = readLine()!!.trim().toInt()
    val coins = List(n){
        val (r, sx, sy, tx, ty) = readLine()!!.trim().split(' ').map(String::toDouble)
        Pair(Circle(Point(sx, sy), r), Circle(Point(tx, ty), r))
    }
    println(solve(coins))
}
