#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
int n, d[1010];
struct node {
  double x, y, r, s;
  bool operator<(const node &a) const { return r < a.r; }
} a[1010];
double s1[1010];
double ss(double r) { return pi * r * r; }
double sqr(double x) { return x * x; }
int main() {
  double ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%lf %lf %lf", &a[i].x, &a[i].y, &a[i].r), a[i].s = ss(a[i].r);
  sort(a + 1, a + n + 1);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      d[i] +=
          (sqr(a[i].x - a[j].x) + sqr(a[i].y - a[j].y) <= sqr(a[j].r - a[i].r));
    ans += a[i].s * (d[i] ? (d[i] & 1 ? 1 : -1) : 1);
  }
  printf("%.8f", ans);
  return 0;
}
