#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <vector>
#include <utility>
#include <set>
//#define LOCAL
#define EPS 1e-10
#define maxn 105
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const double pi = acos(-1);
struct Point{
	double x,y;
	Point(double x = 0.0,double y = 0.0): x(x),y(y) {}
	Point operator + (Point p){
		return Point(x + p.x,y + p.y);
	}
	Point operator - (Point p){
		return Point(x - p.x,y - p.y);
	}
	Point operator * (double lambda){
		return Point(x * lambda,y * lambda);
	}
	Point operator / (double lambda){
		return Point(x / lambda,y / lambda);
	}
	double norm(){
		return x * x + y * y;
	}
	double abs_(){
		return sqrt(norm());
	}
	double pol(){
		return atan2(y,x);
	}
	bool operator == (const Point &p)const
	{
		return abs(x - p.x) < EPS && abs(y - p.y) < EPS;
	}
	bool operator < (const Point &p)const
	{
		if(abs(x - p.x) < EPS) return y < p.y;
		else return x < p.x;
	}
};
typedef Point Vector;
struct Segment{
	Point p1,p2;
	Segment(Point p1 = Point(),Point p2 = Point()): p1(p1),p2(p2) {}
};
typedef Segment Line;
struct Circle{
	Point c;
	double r;
	Circle(Point c = Point(),double r = 0.0): c(c),r(r) {}
};
typedef vector<Point> Polygon;
double dot(Vector a,Vector b){ return a.x * b.x + a.y * b.y; }
double det(Vector a,Vector b){ return a.x * b.y - a.y * b.x; }
Vector rot(Vector a,double theta){//rotate.
	double x1 = cos(theta) * a.x - sin(theta) * a.y;
	double y1 = sin(theta) * a.x + cos(theta) * a.y;
	return Point(x1,y1);
}
int n;
Circle a[maxn];
struct Event{
	double ang;
	int type;//0: start, 1: end.
	Event(double ang = 0.0,int type = 0): ang(ang),type(type) {}
	bool operator < (const Event b){
		return ang < b.ang;
	}
};
double calc(int x){//yuan xin jiao.
	vector <Event> events;
	for(int i=1;i<=n;i++){
		if(i == x) continue;
		Circle c = a[x], d = a[i];
		Vector cendis = d.c - c.c;
		if(cendis.abs_() + EPS > c.r + d.r) continue;
		if(cendis.abs_() < c.r - d.r + EPS) continue;
		if(cendis.abs_() < d.r - c.r + EPS) return 0.0;
		double theta = acos((c.r * c.r + cendis.norm() - d.r * d.r) / (2 * c.r * cendis.abs_()));
		double ang1 = cendis.pol() - theta, ang2 = cendis.pol() + theta;
		if(ang1 < -pi + EPS){
			events.push_back(Event(ang1 + 2 * pi,0));
			events.push_back(Event(pi,1));
			events.push_back(Event(-pi,0));
			events.push_back(Event(ang2,1));
		}else if(ang2 > pi + EPS){
			events.push_back(Event(ang1,0));
			events.push_back(Event(pi,1));
			events.push_back(Event(-pi,0));
			events.push_back(Event(ang2 - 2 * pi,1));
		}else{
			events.push_back(Event(ang1,0));
			events.push_back(Event(ang2,1));
		}
	}
	sort(events.begin(),events.end());
	double tot = 0.0, lst = -pi;
	int cnt = 0;
	for(int i=0;i<(int)events.size();i++){
		if(cnt == 0) tot += events[i].ang - lst;
		lst = events[i].ang;
    if(events[i].type == 1) cnt--;
    else cnt++;
  }
  tot += pi - lst;
  return tot;
}
int main(){
	#ifdef LOCAL
	freopen("sample.in","r",stdin);
	freopen("sample.out","w",stdout);
	#endif
	while(~scanf("%d",&n) && n){
		for(int i=1;i<=n;i++){
			scanf("%lf%lf%lf",&a[i].c.x,&a[i].c.y,&a[i].r);
		}
		double ans = 0.0;
		for(int i=1;i<=n;i++){
			ans += calc(i) * a[i].r;
		}
		printf("%.10f\n",ans);
	}
	return 0;
}



Measured memory_bytes: 3460