#include <bits/stdc++.h>
using namespace std;
const int N = 100000;
const int inf = (int)1e9 + 1;
const long long big = (long long)1e18 + 1;
const int P = 31;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
struct circle {
  long long x, y, r;
  circle() {}
  circle(long long x, long long y, long long r) : x(x), y(y), r(r) {}
  bool in(circle c) {
    return c.r > r &&
           (c.x - x) * (c.x - x) + (c.y - y) * (c.y - y) <= c.r * c.r;
  }
};
circle a[N];
vector<int> g[N];
long long ans = 0;
void dfs(int u, int h) {
  if (h == 0 || h == 1)
    ans += a[u].r * a[u].r;
  else if (h % 2 == 0)
    ans -= a[u].r * a[u].r;
  else
    ans += a[u].r * a[u].r;
  for (int v : g[u]) dfs(v, h + 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(20);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i].x >> a[i].y >> a[i].r;
  int par[n];
  for (int i = 0; i < n; i++) {
    par[i] = -1;
    for (int j = 0; j < n; j++)
      if (j != i && a[i].in(a[j]))
        if (par[i] == -1 || a[j].r < a[par[i]].r) par[i] = j;
  }
  vector<int> roots;
  for (int i = 0; i < n; i++)
    if (par[i] == -1)
      roots.push_back(i);
    else
      g[par[i]].push_back(i);
  for (int i : roots) dfs(i, 0);
  cout << fixed << (long double)ans * pi << endl;
  return 0;
}
