F :: Warlord
Time Limit: 2 Seconds Memory Limit: 65536 KB
There is war, a Multi-Party war! There are several individuals, n, and some parties. Each individual has joined a party. Each party is going to establish a territory. A territory is a circle area that all individual inside the territory are in the same party. Note that the borders of the territory are evaluated as inside it. A territory have to meet an extra condition: There should be at least two scout on the territory. A scout is an individual which positioned on the border of the territory. You are going to calculate the maximum number of territories that can be established satisfying the above conditions.
Input
There are several test cases in the input. Each test case start with the number of individuals, n (1≤n≤100). The input followed by n lines with the format Ti Xi Yi so that Ti is the party name and Xi and Yi are the coordination of the ith individual. Each party name is a string of at most 20 characters from small English alphabet. The coordination are integer with 1 ≤ Xi Yi ≤ 1,000,000. The test case with n as 0, means the end of the output.
Output
For each test case, print the maximum number of territories that can be established.
Sample Input
4 west 1 1 pars 1 2 pars 3 2 east 3 3 0
Sample Output
1Submit
Source: 13th Iran Nationwide Internet Contest - Isfahan