#include <bits/stdc++.h>
using namespace std;
const int N = 1001;
const double pi = 3.1415926535897932384626433832795l;
int n, x[N], y[N], r[N], seq[N];
vector<int> g[N];
double s[N], dp[2][2][N];
bool mark[N];
bool compare(int i, int j) { return r[i] < r[j]; }
bool in(int i, int j) {
  return 1LL * (r[j] - r[i]) * (r[j] - r[i]) >=
         1LL * (x[i] - x[j]) * (x[i] - x[j]) +
             1LL * (y[i] - y[j]) * (y[i] - y[j]);
}
void pre() {
  iota(seq, seq + n, 0);
  sort(seq, seq + n, compare);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (in(seq[i], seq[j])) {
        g[seq[j]].push_back(seq[i]);
        mark[seq[i]] = true;
        break;
      }
  for (int i = 0; i < n; i++) s[i] = 1.0 * r[i] * r[i] * pi;
}
void dfs(int v) {
  double sum[2][2];
  for (int i = 0; i < 4; i++) sum[i / 2][i % 2] = 0;
  mark[v] = true;
  for (auto x : g[v]) {
    dfs(x);
    for (int i = 0; i < 2; i++)
      for (int j = 0; j < 2; j++) sum[i][j] += dp[i][j][x];
  }
  for (int i = 0; i < 2; i++)
    for (int j = 0; j < 2; j++)
      dp[i][j][v] = max(sum[i ^ 1][j] + (i % 2 ? -s[v] : s[v]),
                        sum[i][j ^ 1] + (j % 2 ? -s[v] : s[v]));
}
double solve() {
  double ans = 0;
  for (int i = 0; i < n; i++)
    if (!mark[i]) {
      dfs(i);
      ans += dp[0][0][i];
    }
  return ans;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> r[i];
  pre();
  cout << fixed << setprecision(16) << solve() << endl;
}
