#include <bits/stdc++.h>
using namespace std;
struct circle {
  long long int x, y, r;
  circle() : x(0), y(0), r(0) {}
  circle(long long int x, long long int y, long long int r)
      : x(x), y(y), r(r) {}
};
int N;
circle C[(1000)];
vector<int> ROOTS;
vector<int> CHLD[(1000)];
long long int DP[(1000)][2][2];
const double PI = acos(-1);
bool cmp(const circle &c1, const circle &c2) { return c1.r > c2.r; }
bool is_inside(const circle &c1, const circle &c2) {
  long long int dx = c1.x - c2.x, dy = c1.y - c2.y;
  long long int dr2 = dx * dx + dy * dy;
  return c1.r < c2.r && dr2 < c2.r * c2.r;
}
long long int dfs(int x, int a, int b) {
  1 ? 0 : printf("%d %d %d\n", x, a, b);
  if (DP[x][a][b] >= 0) return DP[x][a][b];
  long long int sqr = C[x].r * C[x].r;
  long long int sa = sqr * ((a == 0) ? 1 : -1);
  long long int sb = sqr * ((b == 0) ? 1 : -1);
  for (auto y : CHLD[x]) {
    sa += dfs(y, 1 ^ a, b);
    sb += dfs(y, a, 1 ^ b);
  }
  DP[x][a][b] = max(sa, sb);
  return DP[x][a][b];
}
void solve() {
  for (int i = 0; i < N; i++) {
    int p = i;
    for (int j = 0; j < N; j++) {
      if (is_inside(C[i], C[j])) {
        if (p == i || C[j].r < C[p].r) p = j;
      }
    }
    if (p == i)
      ROOTS.push_back(i);
    else
      CHLD[p].push_back(i);
  }
  memset(DP, -1, sizeof(DP));
  long long int ans = 0;
  for (auto x : ROOTS) ans += dfs(x, 0, 0);
  printf("%.10f\n", ans * PI);
}
int main() {
  cin >> N;
  for (int i = 0; i < N; i++) {
    long long int x, y, r;
    cin >> x >> y >> r;
    C[i] = circle(x, y, r);
  }
  solve();
  return 0;
}
