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
t = int(input())
mat = [ [0 for i in range(0, 1001)] for j in range(0, 1001)]
 
while(t):
	val = str(raw_input())
	val = val.split(" ")
	x,y,r = int(val[0]), int(val[1]), int(val[2])
	#print("X Y R")
	#print x,y,r
 
	rSquare = r ** 2
	#print("rSquare %d"% rSquare)
	for i in range(1,1001) :
		for j in range(1,1001) :
			if( ((x-i)*(x-i) + (y-j)*(y-j)) <= rSquare ) :
				mat[i][j] = mat[i][j] + 1
				#print mat[i][j]
	t= t - 1
ans = 0
for i in range(1,1001) :
	for j in range(1,1001) :
		if(mat[i][j] > 1) :
			ans = ans + 1
	
print ans