#include <bits/stdc++.h>
using namespace std;
struct node {
  long long x, y;
  node(long long _x = 0, long long _y = 0) : x(_x), y(_y) {}
  node operator-(const node &rhs) const { return node(x - rhs.x, y - rhs.y); }
  long long len2() const { return x * x + y * y; }
};
node arr[1005];
long long r[1005];
vector<int> edge[1005];
int p[1005];
long long ans[1005][2][2];
int vis[1005];
bool inside(node a, long long ra, node b, long long rb) {
  return (a - b).len2() <= rb * rb && rb > ra;
}
long long area(int wh) { return r[wh] * r[wh]; }
void dfs(int wh) {
  if (vis[wh] == 1) return;
  vis[wh] = 1;
  for (size_t i = 0; i < edge[wh].size(); i++) {
    dfs(edge[wh][i]);
  }
  for (int j = 0; j < 2; j++)
    for (int k = 0; k < 2; k++) {
      long long lh = (j == 0 ? area(wh) : -area(wh)),
                rh = (k == 0 ? area(wh) : -area(wh));
      for (size_t i = 0; i < edge[wh].size(); i++) {
        lh += ans[edge[wh][i]][j ^ 1][k];
        rh += ans[edge[wh][i]][j][k ^ 1];
      }
      ans[wh][j][k] = max(lh, rh);
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d %I64d %I64d", &arr[i].x, &arr[i].y, &r[i]);
  }
  memset(p, -1, sizeof(p));
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      if (inside(arr[i], r[i], arr[j], r[j])) {
        if (p[i] == -1 || inside(arr[j], r[j], arr[p[i]], r[p[i]])) p[i] = j;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (p[i] != -1) edge[p[i]].push_back(i);
  }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) ans[i][j][k] = -10000000ll * 10000000;
  memset(vis, 0, sizeof(vis));
  for (int i = 0; i < n; i++) {
    dfs(i);
  }
  double oans = 0;
  for (int i = 0; i < n; i++) {
    if (p[i] == -1) {
      oans += ans[i][0][0] * acos(-1);
    }
  }
  printf("%.8f\n", oans);
  return 0;
}
