#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const int M = 1000 + 10;
int n, deep[M];
double ans;
struct Pt {
  double x, y, r;
  inline bool operator<(const Pt &rhs) const { return r > rhs.r; }
} pt[M];
double dist(Pt a, Pt b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lf%lf%lf", &pt[i].x, &pt[i].y, &pt[i].r);
  pt[0] = Pt{0, 0, 1e15};
  sort(pt + 1, pt + 1 + n);
  for (int i = 1; i <= n; ++i)
    for (int j = i - 1; j >= 0; --j)
      if (dist(pt[i], pt[j]) <= pt[j].r) {
        deep[i] = deep[j] + 1;
        ans += ((deep[i] <= 2 || !(deep[i] & 1)) ? 1.0 : -1.0) * pi * pt[i].r *
               pt[i].r;
        break;
      }
  printf("%.12f\n", ans);
}
