#include <bits/stdc++.h>
using namespace std;
double x[1001], y[1001], r[1001];
int in[1001];
vector<vector<int> > g;
double dist(int i, int j) {
  return sqrt((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}
double area(int i) { return acos(-1) * r[i] * r[i]; }
int main() {
  int n;
  cin >> n;
  g.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> r[i];
    for (int j = 0; j < i; j++) {
      if (dist(i, j) <= max(r[i], r[j]) + 1e-9) {
        if (r[i] > r[j]) {
          in[j]++;
          g[i].push_back(j);
        } else {
          in[i]++;
          g[j].push_back(i);
        }
      }
    }
  }
  double ans = 0;
  queue<pair<int, int> > q;
  for (int i = 0; i < n; i++) {
    if (!in[i]) q.push(make_pair(i, 2));
  }
  while (!q.empty()) {
    int u = q.front().first;
    int add = q.front().second;
    if (add)
      ans += area(u);
    else
      ans -= area(u);
    q.pop();
    for (int i = 0; i < g[u].size(); i++) {
      int v = g[u][i];
      in[v]--;
      if (in[v]) continue;
      q.push(make_pair(v, (add - 1) < 0 ? add + 1 : add - 1));
    }
  }
  cout << fixed << setprecision(10) << ans;
  return 0;
}
