bandu-the-saviour

The Bandu of the Hackers' community had a very urgent job to do. He needs to diffuse all the bombs placed by Poker. Poker is extremely clever and cruel. He selected a region of 1000 X 1000 points, chose N center points of the form (X,Y) and placed bombs on every integral point that was on or inside the circular region of radius R around that chosen point. Then he went to every such point and activated those bombs that lied on or inside at least two such circular regions.

In order to make an efficient plan for the Bomb Disposal Squad, You need to help the Bandu to determine the number of active bombs.

INPUT:

The first line of the input contains the N. Next N lines contain 3 space separated integers X Y R as described above.

OUTPUT:

Print the number of active bombs.

CONSTRAINTS:

1 ≤ N ≤ 10
1 ≤ X,Y,R ≤ 1000
NOTE : The search area for the Bandu is a square with diagonal points (1,1) and (1000,1000)

SAMPLE INPUT
2
5 5 2
3 4 3

SAMPLE OUTPUT
9

Source: hackerearth | Difficulty: EASY


Solutions: