Many Byteotian farmers will remember last summer for a long time. Not because of an unusually rich harvest, nor the opposite (drought and hail), but because of the mysterious circles that appeared across many wheat fields. As Byteotia's expert on all kinds of unusual problems, Byteasar decided to investigate the circle phenomenon scientifically. He inspected the fields carefully and noticed that each circle was formed by flattening the grain over a disk-shaped region. Every two circles meet in at most one point; in particular, no circle lies entirely inside another.
Byteasar suspects that the circles are messages sent by beings from beyond Byteotia. Understanding their language will be very hard, but for now he has built a database of circle arrangements and is analyzing them statistically. The more interesting data he collects, the better. He has asked you to write a program that, for a given arrangement, reports how many pairs of circles share a common point.
The first line contains an integer n (1≤n≤500000), the number of circles in the arrangement. Each of the next n lines describes one circle. The i-th such line contains three integers xi, yi, ri (−109≤xi,yi≤109, 1≤ri≤109), meaning that the i-th circle has its center at (xi,yi) and radius ri.
Print a single integer: the number of pairs of circles that share a common point (that is, pairs that touch at exactly one point).
