#include <bits/stdc++.h>
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
const double PI = 3.14159265358979323846;
struct circle {
  long long int x, y, r, ind;
  circle(long long int x = 0, long long int y = 0, long long int r = 0,
         long long int ind = 0) {
    this->x = x;
    this->y = y;
    this->r = r;
    this->ind = ind;
  }
  double getS() { return r * r; }
};
long long int getR(const circle& a, const circle& b) {
  long long int dx = a.x - b.x;
  long long int dy = a.y - b.y;
  return dx * dx + dy * dy;
}
bool intersects(const circle& a, const circle& b) {
  long long int dr = a.r - b.r;
  return getR(a, b) <= dr * dr;
}
bool cmp(const circle& a, const circle& b) { return a.r < b.r; }
vector<vector<long long int>> g;
vector<circle> a, b;
vector<bool> in;
vector<vector<vector<long long int>>> dp;
void dfs(long long int v) {
  vector<vector<long long int>> pdp(2, vector<long long int>(2));
  for (auto to : g[v]) {
    dfs(to);
    for (long long int i = 0; i < 2; i++) {
      for (long long int j = 0; j < 2; j++) {
        pdp[i][j] += dp[to][i][j];
      }
    }
  }
  for (long long int i = 0; i < 2; i++) {
    for (long long int j = 0; j < 2; j++) {
      dp[v][i][j] = max(pdp[i ^ 1][j] + b[v].getS() * ((i == 0) ? 1 : -1),
                        pdp[i][j ^ 1] + b[v].getS() * ((j == 0) ? 1 : -1));
    }
  }
}
signed main() {
  long long int n;
  cin >> n;
  a.resize(n);
  b.resize(n);
  g.resize(n);
  in.resize(n);
  dp.resize(n,
            vector<vector<long long int>>(2, vector<long long int>(2, -1e15)));
  for (long long int i = 0; i < n; i++) {
    cin >> a[i].x >> a[i].y >> a[i].r;
    b[i] = circle(a[i].x, a[i].y, a[i].r, i);
    a[i].ind = i;
  }
  sort(a.rbegin(), a.rend(), cmp);
  for (long long int i = 0; i < n; i++) {
    for (long long int j = i - 1; j >= 0; j--) {
      if (intersects(a[i], a[j])) {
        in[a[i].ind] = true;
        g[a[j].ind].push_back(a[i].ind);
        break;
      }
    }
  }
  long long int ans = 0;
  for (long long int i = 0; i < n; i++) {
    if (!in[i]) {
      dfs(i);
      ans += dp[i][0][0];
    }
  }
  cout.precision(20);
  cout << ans * PI;
  return 0;
}
