#include <bits/stdc++.h>
using namespace std;
using LL = long long;
const double pi = acos(-1);
double sqr(double r) { return r * r; }
double area(double r) { return pi * sqr(r); }
int x[1234], y[1234], r[1234], cnt[1234], rev[1234];
double dis(int i, int j) { return sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j])); }
int ck(int i, int j) {
  if (r[i] < r[j] && dis(i, j) < r[j]) return 1;
  return 0;
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> r[i];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (ck(i, j)) cnt[i]++;
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (ck(i, j) && cnt[j] == 1) rev[i] = 1;
  double A = 0;
  for (int i = 0; i < n; i++) {
    if (cnt[i] == 1)
      A += area(r[i]);
    else {
      int d = cnt[i] + rev[i];
      if (d & 1)
        A -= area(r[i]);
      else
        A += area(r[i]);
    }
  }
  printf("%.10f\n", A);
  return 0;
}
