#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e3 + 5;
const double pi = acos(-1.0);
struct node {
  int x, y, r;
  int num;
} a[maxn];
int n;
bool cmp(node a, node b) { return a.r > b.r; }
bool in(node a, node b) {
  return 1.0 * (a.x - b.x) * (a.x - b.x) + 1.0 * (a.y - b.y) * (a.y - b.y) <
         1.0 * (a.r + b.r) * (a.r + b.r);
}
double cal(node a) { return pi * a.r * a.r; }
int main() {
  while (cin >> n) {
    for (int i = 1; i <= n; i++)
      scanf("%d%d%d", &a[i].x, &a[i].y, &a[i].r), a[i].num = 0;
    sort(a + 1, a + 1 + n, cmp);
    for (int i = 1; i <= n; i++)
      for (int j = i + 1; j <= n; j++)
        if (in(a[i], a[j])) a[j].num++;
    double ans = 0.0;
    for (int i = 1; i <= n; i++) {
      if (!a[i].num || a[i].num % 2)
        ans += cal(a[i]);
      else
        ans -= cal(a[i]);
    }
    printf("%.8f\n", ans);
  }
  return 0;
}
