#include <bits/stdc++.h>
using namespace std;
struct Vergil {
  int x, y, r;
} t[1005];
int n, father[1005];
long long f[1005][2][2], ans;
vector<int> son[1005];
long long dist(int o1, int o2) {
  return (long long)(t[o1].x - t[o2].x) * (t[o1].x - t[o2].x) +
         (long long)(t[o1].y - t[o2].y) * (t[o1].y - t[o2].y);
}
inline bool bh(int o1, int o2) {
  return dist(o1, o2) < (long long)t[o1].r * t[o1].r;
}
void dfs(int u) {
  int siz = son[u].size();
  long long g[2][2] = {{0}};
  for (int i = 0; i < siz; i++) {
    int v = son[u][i];
    dfs(v);
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) g[j][k] += f[v][j][k];
  }
  long long w = (long long)t[u].r * t[u].r;
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      f[u][i][j] = max(g[i ^ 1][j] + w * (i == 0 ? 1 : -1),
                       g[i][j ^ 1] + w * (j == 0 ? 1 : -1));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d%d%d", &t[i].x, &t[i].y, &t[i].r);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (t[j].r <= t[i].r) continue;
      if (!bh(j, i)) continue;
      if (!father[i] || t[father[i]].r > t[j].r) father[i] = j;
    }
  for (int i = 1; i <= n; i++)
    if (father[i]) son[father[i]].push_back(i);
  for (int i = 1; i <= n; i++)
    if (!father[i]) {
      dfs(i);
      ans += f[i][0][0];
    }
  printf("%.10f\n", ans * acos(-1));
  return 0;
}
