#include <bits/stdc++.h>
using namespace std;
double crar[1007];
double x[1007];
double y[1007];
double r[1007];
long long par[1007];
int main(void) {
  long long n, i, j;
  double pi, ans, ds;
  pi = acos(-1.0);
  scanf("%lld", &n);
  for (i = 1; i <= n; i++) {
    scanf("%lf %lf %lf", &x[i], &y[i], &r[i]);
  }
  for (i = 1; i <= n; i++) {
    for (j = 1; j <= n; j++) {
      if (i == j) continue;
      ds = (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]);
      ds = sqrt(ds);
      if (ds < r[i] && r[j] < r[i]) {
        par[j]++;
      }
    }
  }
  for (i = 1; i <= n; i++) {
    ds = pi * r[i] * r[i];
    crar[par[i]] += ds;
  }
  ans = 0.0;
  ans += crar[0] + crar[1];
  ans -= crar[2];
  for (i = 3; i < 1000; i += 2) {
    ans += (crar[i] - crar[i + 1]);
  }
  printf("%.10lf\n", ans);
  return 0;
}
