#include <bits/stdc++.h>
using namespace std;
int nowx;
const long double pi = acos(-1);
struct line {
  double x, y, r;
  line() {}
  line(double a, double b, double c) { x = a, y = b, r = c; }
  bool operator<(const line &b) const { return r < b.r; }
} pts[400005];
struct Edge {
  int to, next;
} edges[400005];
int cntt = 0, n;
double x[400005], y[400005], r[400005];
int fa[400005], first[200005], te = 0;
long double ans = 0;
void addE(int a, int b) {
  edges[++te].to = b;
  edges[te].next = first[a];
  first[a] = te;
}
void dfs(int x, int fa, int dep) {
  if (dep & 1 || !dep) {
    ans += (1ll * pts[x].r * pts[x].r * pi);
  } else
    ans -= (1ll * pts[x].r * pts[x].r * pi);
  for (int e = first[x]; e; e = edges[e].next) {
    int to = edges[e].to;
    if (to != fa) dfs(to, x, dep + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf%lf%lf", &x[i], &y[i], &r[i]);
    pts[++cntt] = line(x[i], y[i], r[i]);
  }
  sort(pts + 1, pts + n + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j)
      if (pts[j].r - pts[i].r >=
          hypot((pts[i].x - pts[j].x), (pts[i].y - pts[j].y))) {
        fa[i] = j;
        break;
      }
  for (int i = 1; i <= n; ++i)
    if (fa[i]) {
      addE(fa[i], i);
      addE(i, fa[i]);
    }
  for (int i = 1; i <= n; ++i)
    if (!fa[i]) dfs(i, -1, 0);
  printf("%.10lf", (double)ans);
  return 0;
}
