#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
vector<int> g[maxn];
struct node {
  double x, y;
  double r;
  double s;
  bool operator<(const node& A) const { return r < A.r; }
} a[maxn];
int n;
void read(int& x) {
  x = 0;
  int f = 1;
  char c = getchar();
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + c - '0';
    c = getchar();
  }
  x *= f;
}
double dist(int i, int j) {
  return sqrt((a[i].x - a[j].x) * (a[i].x - a[j].x) +
              (a[i].y - a[j].y) * (a[i].y - a[j].y));
}
bool check(int i, int j) {
  double d = dist(i, j);
  return (d <= a[i].r);
}
int fa[maxn];
int dep[maxn];
double sum[maxn];
void dfs(int x) {
  sum[dep[x]] += a[x].s;
  for (int i = 0; i < g[x].size(); i++) {
    int v = g[x][i];
    dep[v] = dep[x] + 1;
    dfs(v);
  }
}
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf%lf", &a[i].x, &a[i].y, &a[i].r);
    a[i].s = acos(-1.0) * a[i].r * a[i].r;
  }
  sort(a + 1, a + 1 + n);
  for (int i = 1; i <= n; i++) {
    for (int j = i - 1; j >= 1; j--) {
      if (!fa[j] && check(i, j)) {
        fa[j] = i;
        g[i].push_back(j);
      }
    }
  }
  for (int i = 1; i <= n; i++)
    if (!fa[i]) fa[i] = n + 1, g[n + 1].push_back(i);
  a[n + 1] = (node){0, 0, 0, 0};
  dfs(n + 1);
  double ans;
  ans = sum[1];
  for (int i = 2; i <= n; i += 2) {
    ans += sum[i] - sum[i + 1];
  }
  printf("%.10lf", ans);
  return 0;
}
