#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 10;
const double EPS = 1e-7;
const int maxn = 1005;
int x[maxn], y[maxn], r[maxn];
vector<int> g[maxn];
int par[maxn];
bool judge(int i, int j) {
  return 1LL * (x[i] - x[j]) * (x[i] - x[j]) +
             1LL * (y[i] - y[j]) * (y[i] - y[j]) <=
         1LL * (r[j] - r[i]) * (r[j] - r[i]);
}
long long d[1005][2][2];
void dfs(int u) {
  long long val[2][2];
  memset(val, 0, sizeof(val));
  for (int i = 0; i < g[u].size(); i++) {
    int v = g[u][i];
    dfs(v);
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) val[i][j] += d[v][i][j];
  }
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++) {
      d[u][i][j] = max(val[i ^ 1][j] + 1LL * r[u] * r[u] * (i == 0 ? 1 : -1),
                       val[i][j ^ 1] + 1LL * r[u] * r[u] * (j == 0 ? 1 : -1));
    }
}
int main() {
  int n;
  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++) {
    par[i] = -1;
    for (int j = 0; j < n; j++) {
      if (r[j] > r[i] && judge(i, j)) {
        if (par[i] == -1 || r[par[i]] > r[j]) {
          par[i] = j;
        }
      }
    }
    g[par[i]].push_back(i);
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (par[i] == -1) {
      dfs(i);
      ans += 1LL * d[i][0][0];
    }
  }
  printf("%.8f", (double)ans * acos(-1.0));
  return 0;
}
