## Archivo de 24 horas: Problema

###
** 4161
- Circles and Aliens** ** 4161 - Circles and Aliens** ** 4161 - Circles and Aliens**

#### Descripción

The farmers of Byteland will remember the last summer for a long time. Usually a summer burns into one’s memory due to plentiful harvest, severe drought or hail. However the last summer was so extraordinary because of strange shapes, which appeared at several wheat fields. As a Bytean expert in all unusual problems, Byteasar decided to explain this phenomenon on the ground of science. In order to do this, he thoroughly inspected each wheat field and noticed that each shape was made by crumbling all wheat belonging to a circular region. Every two circles touch in at most one point (in particular no circle can be contained in a different circle).

Byteasar suspects that the circles describe messages sent by aliens. Unfortunately, understanding their language is very hard. At this point Byteasar collected all the information about the shapes he found and he is going to use some tools of statistical analysis. The more interesting data he collects, the better. Byteasar asked you to write a program, which given the description of all the circles computes the number of pairs of circles having a common point.

Byteasar suspects that the circles describe messages sent by aliens. Unfortunately, understanding their language is very hard. At this point Byteasar collected all the information about the shapes he found and he is going to use some tools of statistical analysis. The more interesting data he collects, the better. Byteasar asked you to write a program, which given the description of all the circles computes the number of pairs of circles having a common point.

Byteasar suspects that the circles describe messages sent by aliens. Unfortunately, understanding their language is very hard. At this point Byteasar collected all the information about the shapes he found and he is going to use some tools of statistical analysis. The more interesting data he collects, the better. Byteasar asked you to write a program, which given the description of all the circles computes the number of pairs of circles having a common point.

Byteasar suspects that the circles describe messages sent by aliens. Unfortunately, understanding their language is very hard. At this point Byteasar collected all the information about the shapes he found and he is going to use some tools of statistical analysis. The more interesting data he collects, the better. Byteasar asked you to write a program, which given the description of all the circles computes the number of pairs of circles having a common point.

#### Especificación de entrada

The first line of input contains a single integer

*n*(1 ≤*n*≤ 500000), the number of circles. Each of the following*n*lines describes a circle. In the*i-th*of those lines there are three integers*x*,_{i}*y*,_{i}*r*(−10_{i}^{9}≤*x*,_{i}*y*≤ 10_{i}^{9}, 1 ≤*r*≤ 10_{i}^{9}), meaning that the center of the*i-th*circle has coordinates (*x*,_{i}*y*) while its radius equals_{i}*r*._{i}*n*(1 ≤

*n*≤ 500000), the number of circles. Each of the following

*n*lines describes a circle. In the

*i-th*of those lines there are three integers

*x*,

_{i}*y*,

_{i}*r*(−10

_{i}^{9}≤

*x*,

_{i}*y*≤ 10

_{i}^{9}, 1 ≤

*r*≤ 10

_{i}^{9}), meaning that the center of the

*i-th*circle has coordinates (

*x*,

_{i}*y*) while its radius equals

_{i}*r*.

_{i}*n*(1 ≤

*n*≤ 500000), the number of circles. Each of the following

*n*lines describes a circle. In the

*i-th*of those lines there are three integers

*x*,

_{i}*y*,

_{i}*r*(−10

_{i}^{9}≤

*x*,

_{i}*y*≤ 10

_{i}^{9}, 1 ≤

*r*≤ 10

_{i}^{9}), meaning that the center of the

*i-th*circle has coordinates (

*x*,

_{i}*y*) while its radius equals

_{i}*r*.

_{i}#### Especificación de salida

Your program should output the number of pairs of circles having a common point.

Your program should output the number of pairs of circles having a common point.

*n*(1 ≤

*n*≤ 500000), the number of circles. Each of the following

*n*lines describes a circle. In the

*i-th*of those lines there are three integers

*x*,

_{i}*y*,

_{i}*r*(−10

_{i}^{9}≤

*x*,

_{i}*y*≤ 10

_{i}^{9}, 1 ≤

*r*≤ 10

_{i}^{9}), meaning that the center of the

*i-th*circle has coordinates (

*x*,

_{i}*y*) while its radius equals

_{i}*r*.

_{i}#### Ejemplo de entrada

`40 0 58 6 5-6 8 52 14 5`

#### Ejemplo de salida

`4`