#jag2017autumng. [jag2017autumn_g]Coin Slider

[jag2017autumn_g]Coin Slider

MathJax.Hub.Config({ tex2jax: { inlineMath: [["","",""], ["\\(","\\)"]], processEscapes: true }}); blockquote { font-family: Menlo, Monaco, "Courier New", monospace; color: #333333; display: block; padding: 8.5px; margin: 0 0 9px; font-size: 16px; line-height: 18px; background-color: #f5f5f5; border: 1px solid rgba(0, 0, 0, 0.15); -webkit-border-radius: 4px; -moz-border-radius: 4px; border-radius: 4px; white-space: pre; white-space: pre-wrap; word-break: break-all; word-wrap: break-word; }

Problem Statement

You are playing a coin puzzle. The rule of this puzzle is as follows:

There are NN coins on a table. The ii-th coin is a circle with r_ir\_i radius, and its center is initially placed at (sx_i,sy_i)(sx\_i, sy\_i). Each coin also has a target position: you should move the ii-th coin so that its center is at (tx_i,ty_i)(tx\_i, ty\_i). You can move coins one by one and can move each coin at most once. When you move a coin, it must move from its initial position to its target position along the straight line. In addition, coins cannot collide with each other, including in the middle of moves.

The score of the puzzle is the number of the coins you move from their initial position to their target position. Your task is to write a program that determines the maximum score for a given puzzle instance.


Input

The input consists of a single test case formatted as follows.

NN r_1r\_{1} sx_1sx\_{1} sy_1sy\_{1} tx_1tx\_{1} ty_1ty\_{1} vdots\\vdots r_Nr\_{N} sx_Nsx\_{N} sy_Nsy\_{N} tx_Ntx\_{N} ty_Nty\_{N}

The first line contains an integer NN (1leNle161 \\le N \\le 16), which is the number of coins used in the puzzle. The ii-th line of the following NN lines consists of five integers: r_ir\_i, sx_isx\_i, sy_isy\_i, tx_itx\_i, and ty_ity\_i (1ler_ile1,0001 \\le r\_i \\le 1{,}000, $-1{,}000 \\le sx\_i, sy\_i, tx\_i, ty\_i \\le 1{,}000$, (sx_i,sy_i)neq(tx_i,ty_i)(sx\_i, sy\_i) \\neq (tx\_i, ty\_i)). They describe the information of the ii-th coin: r_ir\_i is the radius of the ii-th coin, (sx_i,sy_i)(sx\_i, sy\_i) is the initial position of the ii-th coin, and (tx_i,ty_i)(tx\_i, ty\_i) is the target position of the ii-th coin.

You can assume that the coins do not contact or are not overlapped with each other at the initial positions. You can also assume that the maximum score does not change even if the radius of each coin changes by 10510^{-5}.

Output

Print the maximum score of the given puzzle instance in a line.


Sample Input 1

3
2 0 0 1 0
2 0 5 1 5
4 1 -10 -5 10

Output for Sample Input 1

2

Sample Input 2

3
1 0 0 5 0
1 0 5 0 0
1 5 5 0 5

Output for Sample Input 2

3

Sample Input 3

4
1 0 0 5 0
1 0 5 0 0
1 5 5 0 5
1 5 0 0 0

Output for Sample Input 3

0

Note

In the first example, the third coin cannot move because it is disturbed by the other two coins.

Example 1. Initial Positions

Example 1. After Movements