#include <bits/stdc++.h>
using namespace std;
const double PI = acos(double(-1));
int n;
struct circle {
  int x, y, r;
  double s;
} a[1500];
int fa[1500];
vector<int> g[1500];
double f[1500][2][2];
int o[1500];
struct info {
  int x, y, z;
} oo[1500][2][2];
void update(double &x, double y) {
  if (y > x) x = y;
}
double dfs(int x, int parity, int parity2) {
  if (f[x][parity][parity2]) return f[x][parity][parity2];
  double res = 0;
  if (parity == 0) {
    res += a[x].s;
  } else {
    res -= a[x].s;
  }
  for (int i = 0; i < g[x].size(); i++) {
    int t = g[x][i];
    if (t != fa[x]) {
      res += dfs(t, 1 - parity, parity2);
    }
  }
  int opt = 0;
  if (f[x][parity][parity2] < res) {
    opt = 1;
  }
  f[x][parity][parity2] = res;
  res = 0;
  if (parity2 == 0) {
    res += a[x].s;
  } else {
    res -= a[x].s;
  }
  for (int i = 0; i < g[x].size(); i++) {
    int t = g[x][i];
    if (t != fa[x]) {
      res += dfs(t, parity, 1 - parity2);
    }
  }
  if (f[x][parity][parity2] < res) {
    opt = 2;
  }
  update(f[x][parity][parity2], res);
  o[x] = opt;
  return f[x][parity][parity2];
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    circle &t = a[i];
    cin >> t.x >> t.y >> t.r;
    t.s = PI * t.r * t.r;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) {
        circle u = a[i], v = a[j];
        int x = i, y = j;
        double d = sqrt(double(u.x - v.x) * (u.x - v.x) +
                        double(u.y - v.y) * (u.y - v.y));
        if (u.r < v.r) {
          swap(u, v);
          swap(x, y);
        }
        if (d <= u.r) {
          if (!fa[y])
            fa[y] = x;
          else {
            if (u.r < a[fa[y]].r) fa[y] = x;
          }
        }
      }
  for (int i = 1; i <= n; i++)
    if (fa[i]) {
      g[fa[i]].push_back(i);
    }
  double ans = 0;
  for (int i = 1; i <= n; i++)
    if (fa[i] == 0) {
      ans += dfs(i, 0, 0);
    }
  printf("%.8lf\n", ans);
  return 0;
}
