#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000 + 10;
struct Circle {
  double x, y, r;
  void read() { scanf("%lf%lf%lf", &x, &y, &r); }
  bool operator<(const Circle& t) const { return r < t.r; }
};
int n;
Circle a[maxn];
vector<int> G[maxn];
const double PI = acos(-1.0);
const double eps = 1e-8;
int dcmp(double x) {
  if (fabs(x) < eps) return 0;
  return x < 0 ? -1 : 1;
}
bool in(int i, int j) {
  return dcmp(((a[i].x - a[j].x) * (a[i].x - a[j].x)) +
              ((a[i].y - a[j].y) * (a[i].y - a[j].y)) -
              ((a[j].r - a[i].r) * (a[j].r - a[i].r))) <= 0;
}
double ans;
void dfs(int u, int d) {
  if (d) {
    if (d == 1 || (d % 2 == 0))
      ans += ((a[u].r) * (a[u].r));
    else
      ans -= ((a[u].r) * (a[u].r));
  }
  for (int v : G[u]) dfs(v, d + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) a[i].read();
  sort(a + 1, a + n + 1);
  for (int i = 1; i < n + 1; i++) {
    bool find = false;
    for (int j = i + 1; j < n + 1; j++)
      if (in(i, j)) {
        G[j].push_back(i);
        find = true;
        break;
      }
    if (!find) G[0].push_back(i);
  }
  dfs(0, 0);
  printf("%.10f\n", ans * PI);
  return 0;
}
