#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1005;
const double pi = acos(-1.0);
long long x[MAXN], y[MAXN], r[MAXN];
vector<int> G[MAXN];
long long dp[MAXN][2][2];
void dfs(int u) {
  vector<vector<long long>> g(2, vector<long long>(2, 0));
  for (int i = 0; i < (int)G[u].size(); ++i) {
    dfs(G[u][i]);
    for (int j = 0; j < 2; ++j) {
      for (int k = 0; k < 2; ++k) {
        g[j][k] += dp[G[u][i]][j][k];
      }
    }
  }
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      dp[u][i][j] = max(g[i ^ 1][j] + r[u] * r[u] * (i == 0 ? 1 : -1),
                        g[i][j ^ 1] + r[u] * r[u] * (j == 0 ? 1 : -1));
    }
  }
}
int n;
int belong[MAXN];
bool contain(int c1, int c2) {
  return (x[c1] - x[c2]) * (x[c1] - x[c2]) +
             (y[c1] - y[c2]) * (y[c1] - y[c2]) <=
         (r[c1] - r[c2]) * (r[c1] - r[c2]);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lld%lld%lld", x + i, y + i, r + i);
  }
  for (int i = 1; i <= n; ++i) belong[i] = -1;
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (r[i] < r[j] && contain(i, j)) {
        if (belong[i] == -1 || r[belong[i]] > r[j]) {
          belong[i] = j;
        }
      }
    }
    G[belong[i]].push_back(i);
  }
  long long ans = 0;
  for (int i = 1; i <= n; ++i)
    if (belong[i] == -1) {
      dfs(i);
      ans += dp[i][0][0];
    }
  printf("%.8f", 1.0 * pi * ans);
  return 0;
}
