#include <bits/stdc++.h>
long long sqr(int n) { return 1ll * n * n; }
const int maxn = 1000 + 10;
const double PI = acos(-1);
std::vector<int> G[maxn];
int x[maxn], y[maxn], r[maxn], idx[maxn];
bool vis[maxn];
long long ans;
bool cmp(int a, int b) { return r[a] > r[b]; }
void dfs(int u, int dep) {
  vis[u] = true;
  if (dep == 0 || dep & 1) {
    ans += sqr(r[u]);
  } else
    ans -= sqr(r[u]);
  for (auto v : G[u]) dfs(v, dep + 1);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    idx[i] = i;
    scanf("%d%d%d", x + i, y + i, r + i);
  }
  std::sort(idx, idx + n, cmp);
  for (int i = n - 1; i >= 0; i--) {
    for (int j = i - 1; j >= 0; j--) {
      int a = idx[i], b = idx[j];
      if (sqr(x[a] - x[b]) + sqr(y[a] - y[b]) <= sqr(r[a] - r[b])) {
        G[b].push_back(a);
        break;
      }
    }
  }
  for (int i = 0; i < n; i++)
    if (!vis[idx[i]]) {
      dfs(idx[i], 0);
    }
  printf("%.10lf", PI * ans);
  return 0;
}
