#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1100;
const double PI = 3.141592653589793238462643;
int x[MAXN], y[MAXN], r[MAXN];
pair<double, int> ar[MAXN];
vector<int> v[MAXN], nv[MAXN];
long long int dp[MAXN][2][2];
bool used[MAXN], fl[MAXN];
int c = 0;
bool cmp(int a, int b) { return v[a].size() > v[b].size(); }
void makeGraph(int node) {
  used[node] = 1;
  sort(v[node].begin(), v[node].end(), cmp);
  for (int i = 0; i < v[node].size(); i++) {
    int to = v[node][i];
    if (!used[to]) {
      nv[node].push_back(to);
      makeGraph(to);
    }
  }
}
void dfs(int node) {
  long long int cdp[2][2] = {{0, 0}, {0, 0}};
  for (int to : nv[node]) {
    dfs(to);
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) cdp[i][j] += dp[to][i][j];
  }
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      dp[node][i][j] = max(cdp[1 - i][j] + (r[node] * (long long int)r[node]) *
                                               (i == 0 ? -1 : 1),
                           cdp[i][1 - j] + (r[node] * (long long int)r[node]) *
                                               (j == 0 ? -1 : 1));
}
int main() {
#pragma warning(disable : 4996)
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d%d%d", &x[i], &y[i], &r[i]);
  }
  for (int i = 0; i < n; i++) {
    int p = 0;
    for (int j = 0; j < n; j++, p++) {
      if (j == i) {
        p--;
        continue;
      }
      long long int k1 = x[i] - x[j], k2 = y[i] - y[j];
      if (r[j] + sqrt(k1 * k1 + k2 * k2) <= r[i]) {
        v[i].push_back(j);
        fl[j] = true;
      }
    }
  }
  for (int i = 0; i < n; i++) {
    if (fl[i] == false) makeGraph(i);
  }
  long long int ans = 0;
  for (int i = 0; i < n; i++) {
    if (fl[i] == false) {
      long long int cur = 0;
      dp[i][1][0] = dp[i][0][1] = dp[i][1][1] = -1;
      dfs(i);
      for (int a = 0; a < 2; a++) {
        for (int b = 0; b < 2; b++) cur = max(cur, dp[i][a][b]);
      }
      ans += cur;
    }
  }
  printf("%0.9f", ans * PI);
  return 0;
}
