#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <vector>
#include <math.h>
#include <bitset>
#include <algorithm>
using namespace std;
#define X first
#define Y second
#define eps 1e-2
#define gcd __gcd
#define pb push_back
#define PI acos(-1.0)
#define lowbit(x) (x)&(-x)
#define bug printf("!!!!!\n");
#define mem(x,y) memset(x,y,sizeof(x))
typedef long long LL;
typedef long double LD;
typedef pair<int,int> pii;
typedef unsigned long long uLL;
const int N = 1e5+2;
const int INF = 1<<30;
const int mod = 1e9+7;
int n;
struct node
{
double x,y,r;
int times;
bool operator <(const node &b) const {
return (x-b.x)*(x-b.x)+(y-b.y)*(y-b.y)<b.r*b.r&&r<b.r;
}
}p[N];
double getd(node a){
return a.r*a.r*PI;
}
void solve(){
scanf("%d",&n);
for(int i=1;i<=n;i++){
double x,y,r;scanf("%lf%lf%lf",&x,&y,&r);
p[i]={x,y,r};
}
double ans=0;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(i!=j){
if(p[i]<p[j]) p[i].times++;
}
}
}
for(int i=1;i<=n;i++){
if(p[i].times==0||p[i].times&1) ans+=getd(p[i]);
else ans-=getd(p[i]);
}
printf("%0.9lf\n",ans);
return;
}
int main()
{
int t = 1;
while(t--){
solve();
}
return 0;
}