#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1010;
const double pi = acos(-1.0);
long long n;
struct plist {
  long long x, y, r;
} P[maxn];
long long par[maxn];
vector<int> E[maxn];
long long D[maxn][2][2];
double dist(int u, int v) {
  return sqrt((P[u].x - P[v].x) * (P[u].x - P[v].x) +
              (P[u].y - P[v].y) * (P[u].y - P[v].y));
}
void dfs(int u) {
  long long child[2][2] = {
      0,
  };
  int i, j;
  for (auto v : E[u]) {
    dfs(v);
    for (i = 0; i <= 1; i++) {
      for (j = 0; j <= 1; j++) {
        child[i][j] += D[v][i][j];
      }
    }
  }
  long long tmp1, tmp2, R;
  for (i = 0; i <= 1; i++) {
    for (j = 0; j <= 1; j++) {
      R = P[u].r * P[u].r;
      tmp1 = child[1 - i][j] + R * (i == 0 ? 1 : -1);
      tmp2 = child[i][1 - j] + R * (j == 0 ? 1 : -1);
      D[u][i][j] = max(tmp1, tmp2);
    }
  }
}
int main() {
  scanf("%d", &n);
  int i;
  for (i = 1; i <= n; i++) scanf("%lld%lld%lld", &P[i].x, &P[i].y, &P[i].r);
  int j;
  for (i = 1; i <= n; i++) {
    par[i] = -1;
    for (j = 1; j <= n; j++) {
      if (P[i].r < P[j].r && dist(i, j) < (double)P[j].r) {
        if (par[i] == -1 || P[par[i]].r > P[j].r) par[i] = j;
      }
    }
    if (par[i] != -1) E[par[i]].push_back(i);
  }
  double ans = 0;
  for (i = 1; i <= n; i++) {
    if (par[i] == -1) {
      dfs(i);
      ans += D[i][0][0] * pi;
    }
  }
  printf("%.8lf\n", ans);
  return 0;
}
