#include <bits/stdc++.h>
using namespace std;
char ch;
bool fl;
template <typename Typeread>
void read(Typeread &a) {
  for (fl = 0, ch = getchar(); ch < '0' || ch > '9'; ch = getchar())
    fl |= (ch == '-');
  for (a = 0; ch >= '0' && ch <= '9'; ch = getchar())
    a = ((a + (a << 2)) << 1) + (ch ^ '0');
  a = fl ? -a : a;
}
const int N = 2e3 + 10;
const int inf = 0x7ffffff;
const double pi = acos(-1);
struct Cir {
  int x, y, r, Dep;
  bool include(Cir a) {
    double Dis = sqrt((long long)(x - a.x) * (x - a.x) +
                      (long long)(y - a.y) * (y - a.y));
    if (Dis + a.r <= r) return 1;
    return 0;
  }
} c[N];
bool cmp(const Cir &a, const Cir &b) { return a.r > b.r; }
int Pas[N], fir[N], fa[N], Dep[N];
int n, tot;
long long Ans = 0;
int main() {
  read(n);
  for (int i = 1; i <= n; i++) {
    read(c[i].x);
    read(c[i].y);
    read(c[i].r);
  }
  sort(c + 1, c + n + 1, cmp);
  for (int i = 1; i <= n; i++) Pas[i] = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++)
      if (c[i].include(c[j])) Pas[j]++;
  }
  for (int i = 1; i <= n; i++)
    if (Pas[i] > 1 && (!(Pas[i] & 1)))
      Ans -= (long long)c[i].r * c[i].r;
    else
      Ans += (long long)c[i].r * c[i].r;
  printf("%.9f", pi * Ans);
  return 0;
}
