Background
Everyone knows that a glass is the most useful thing to make biscuits. And big biscuit lover Michael broke his only glass yesterday. But this didn't stop him from doing his favorite thing.
Problem
Michael prepared dough, then rolled out it on the surface of the table as a circle of radius 32000 with a center at point (0, 0) and finally started to cut biscuits. It must be said that he tried his best and even perspired profusely. Since Michael had not got any glass, he used all round objects he could reach - pickle-jars, herring-cans, pots, a collection of beer mugs, and even bottle lids. Over and over again Michael took the next round object of radius R[i], put it on the surface of the dough so that its center was at point with Cartesian coordinates X[i] and Y[i]. As a result of each action the next thin round cut appeared on the surface of the dough - an outline of future biscuit.
As soon as the last pot was soiled, and favorite tea-set vanished into the depth of the bin, Michael finally stopped and looked at the result of his work. His eyes grew dim, and his forehead furrowed. The point was that some cuts intersected, so not all of the biscuits were round. Some of them even had holes. But it could not stop Michael, who is going to calculate the number of prepared biscuits.
Input
The first line contains the integer number N (0 ≤ N ≤ 500). Each of the next N lines contains the integer numbers X[i], Y[i] (-10000 ≤ X[i], Y[i] ≤ 10000) and R[i] (1 ≤ R[i] ≤ 10000) for the corresponding cut.
It is guaranteed that any two distinct intersection or touch points of the cutting circles lay at the distance of at least 10-3.
Output
You should output the number of the biscuits prepared by Michael.
Sample
input | output |
---|
3
-1 0 2
1 0 2
0 0 3
| 6
|
Problem Author: Nikita Rybak, Ilya Grebnov, Dmitry Kovalioff
Problem Source: Timus Top Coders: First Challenge