Mine Field#1470

Mine Field

1 second
64 megabytes
Easy

"Two things are infinite: the universe and human stupidity; and I'm not sure about the universe."

Albert Einstein

During World War II, we received distressing news from the enemy camp: four of our spies have been lost. The fifth, Hyperion, has been captured and is being interrogated to reveal the names of the others. We must act.

From the last information delivered by our spies, we know that there are minefields in the enemy camp. The coordinates of the mines are known, and each mine has a certain blast radius. If anything moves within this radius, or if another mine explodes inside it, then this mine also explodes, destroying everything within its range. To infuriate the enemy, we want to fire a missile into their camp and detonate as many mines as possible.

Input

The input consists of several test cases. Each test case starts with an integer , the number of mines. Then lines follow, each containing integers: the first two are and , the coordinates of the mine, and the third is , the blast radius. Two consecutive test cases are separated by a blank line. Input terminates at end of file. It is guaranteed that N \leq 1000, -100 \leq X, Y \leq 100, R < 10.

Output

For each test case, output one line containing the maximum number of mines that can be destroyed.

Examples

Example 1

Loading
Loading