#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1200;
const double PI = acos(-1);
vector<int> G[MAXN];
int n, dep[MAXN], p[MAXN];
struct node {
  int x, y, r;
  void read() { scanf("%d%d%d", &x, &y, &r); }
  bool operator<(const node& rhs) const { return r > rhs.r; }
} C[MAXN];
void dfs(int u, int d) {
  dep[u] = d;
  for (int i = 0; i < G[u].size(); ++i) {
    int v = G[u][i];
    dfs(v, d + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) C[i].read();
  sort(C + 1, C + n + 1);
  for (int i = 1; i <= n; ++i)
    for (int j = i + 1; j <= n; ++j)
      if ((long long)(C[i].r + C[j].r) * (C[i].r + C[j].r) >
          (long long)(C[i].x - C[j].x) * (C[i].x - C[j].x) +
              (long long)(C[i].y - C[j].y) * (C[i].y - C[j].y))
        p[j] = i;
  for (int i = 1; i <= n; ++i)
    if (p[i]) {
      int j = p[i];
      G[j].push_back(i);
    }
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    if (!p[i]) dfs(i, 0);
  for (int i = 1; i <= n; ++i) {
    if (dep[i] == 0 || dep[i] == 1 || dep[i] % 2 == 1)
      ans += (long long)C[i].r * C[i].r;
    else
      ans -= (long long)C[i].r * C[i].r;
  }
  printf("%.9f\n", PI * ans);
}
