#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int N = 1010;
int n, x[N], y[N], r[N];
int deg[N];
vector<int> adj[N];
double A[N];
queue<int> Q[2];
long long dist(int i, int j) {
  long long dx = x[i] - x[j];
  long long dy = y[i] - y[j];
  return dx * dx + dy * dy;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) scanf("%d %d %d", x + i, y + i, r + i);
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (i != j)
        if (dist(i, j) <= 1ll * r[i] * r[i] && r[i] > r[j])
          adj[i].push_back(j), deg[j]++;
  for (int i = 0; i < n; i++)
    if (!deg[i]) Q[0].push(i);
  int i = 0;
  while (!Q[i & 1].empty()) {
    while (!Q[i & 1].empty()) {
      int id = Q[i & 1].front();
      Q[i & 1].pop();
      A[i] += pi * r[id] * r[id];
      for (auto j : adj[id]) {
        deg[j]--;
        if (!deg[j]) Q[1 - i & 1].push(j);
      }
    }
    i++;
  }
  double Ans = 0.0;
  for (int i = 0; i < n; i++) {
    if (i < 2)
      Ans += A[i];
    else
      Ans += A[i] * ((1 - i & 1) ? -1.0 : 1.0);
  }
  printf("%.15f\n", Ans);
  return 0;
}
