doublesqr(double x){return x * x;} doubledist(power a, power b){returnsqrt(sqr(a.x - b.x) + sqr(a.y - b.y));}
doubleCalc(power a, power b) { double A = a.r, B = b.r, C = dist(a, b); double cosB = (sqr(A) + sqr(C) - sqr(B)) / (2 * A * C); double angle = atan2(a.x - b.x, a.y - b.y), add = acos(cosB); stk[++top] = (circle){angle - add, angle + add}; }
doubleinit(power a, power b){return a.r + dist(a, b) <= b.r;} doublesect(power a, power b){returnfabs(a.r - b.r) < dist(a, b) && dist(a, b) < a.r + b.r;}
doubleDeal(int id) { top = 0; for(int i = id+1; i <= n; i++) if(init(a[id], a[i])) return0;
for(int i = id+1; i <= n; i++) if(sect(a[id], a[i])) Calc(a[id], a[i]);
sort(stk + 1, stk + top + 1, cmp); double last = 0.0, sum = 0.0; for(int i = 1; i <= top; i++) if(stk[i].a > last) sum += stk[i].a - last, last = stk[i].b; else last = max(last, stk[i].b);
sum += 2 * pi - last; return a[id].r * sum; }
intmain() { n = get(); for(int i = 1; i <= n; i++) scanf("%lf %lf %lf", &a[i].r, &a[i].x, &a[i].y); for(int i = 1; i <= n; i++) Ans += Deal(i); printf("%.3lf", Ans); }