#include <bits/stdc++.h>
using namespace std;
struct arr {
  int i;
  double s;
} e[1506];
int n, m, x[1506], y[1506], w[1506], f[1506][1506], v[1506][2];
double ans, s[1506];
inline bool cmp(arr x, arr y) { return x.s > y.s; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d%d%d", &x[i], &y[i], &w[i]),
        e[i].s = 1.0 * w[i] * w[i] * acos(-1.0), e[i].i = i;
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      double t = sqrt(1.0 * (x[i] - x[j]) * (x[i] - x[j]) +
                      1.0 * (y[i] - y[j]) * (y[i] - y[j]));
      if (1.0 * w[i] >= 1.0 * w[j] + t) f[i][j] = 1;
    }
  sort(e + 1, e + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    if (!v[e[i].i][0]) {
      ans += e[i].s;
      for (int j = 1; j <= n; j++)
        if (f[e[i].i][j]) v[j][0] = 1;
    } else if (!v[e[i].i][1]) {
      ans += e[i].s;
      for (int j = 1; j <= n; j++)
        if (f[e[i].i][j]) v[j][1] = 1;
    } else {
      ans -= e[i].s;
      for (int j = 1; j <= n; j++)
        if (f[e[i].i][j]) v[j][0] = 0;
    }
  }
  printf("%.12lf\n", ans);
}
