#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const double pi = acos(-1.0);
struct Cir {
  long long x, y, r;
} c[N];
int n, fir[N], tot, fa[N];
long long f[2][2][N], ans;
struct Edge {
  int to, nxt;
} edge[N];
void addedge(int x, int y) {
  edge[tot] = (Edge){y, fir[x]};
  fir[x] = tot++;
}
void dfs(int x) {
  long long g[2][2] = {{0}};
  for (int i = fir[x]; i != -1; i = edge[i].nxt) {
    dfs(edge[i].to);
    for (int a = 0; a < 2; ++a)
      for (int b = 0; b < 2; ++b) g[a][b] += f[a][b][edge[i].to];
  }
  if (x == n + 1) {
    for (int i = fir[x]; i != -1; i = edge[i].nxt) ans += f[0][0][edge[i].to];
    return;
  }
  for (int a = 0; a < 2; ++a)
    for (int b = 0; b < 2; ++b)
      f[a][b][x] = max(g[a][b ^ 1] + c[x].r * c[x].r * (b == 0 ? 1 : -1),
                       g[a ^ 1][b] + c[x].r * c[x].r * (a == 0 ? 1 : -1));
}
bool contain(int x, int y) {
  return (c[x].r - c[y].r) * (c[x].r - c[y].r) >=
         (c[x].x - c[y].x) * (c[x].x - c[y].x) +
             (c[x].y - c[y].y) * (c[x].y - c[y].y);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld%lld%lld", &c[i].x, &c[i].y, &c[i].r);
  c[n + 1].x = c[n + 1].y = 0;
  c[n + 1].r = 1000000000;
  memset(fir, -1, sizeof(fir));
  c[0].r = 1ll << 61;
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n + 1; ++j)
      if (c[i].r < c[j].r && contain(j, i) && c[j].r < c[fa[i]].r) fa[i] = j;
  for (int i = 1; i <= n; ++i) addedge(fa[i], i);
  dfs(n + 1);
  printf("%.8f", pi * ans);
  return 0;
}
