#include <bits/stdc++.h>
using namespace std;
long double pi = acosl(-1);
const int maxn = 1010;
int par[maxn], cnt[maxn], h[maxn];
struct Circle {
  int x, y, r;
  Circle(int x = 0, int y = 0, int r = 0) : x(x), y(y), r(r) {}
  void input() { scanf("%d%d%d", &x, &y, &r); }
  bool operator<(const Circle& c) const { return r < c.r; }
  bool inner(Circle& C) {
    long long d2 =
        (long long)(x - C.x) * (x - C.x) + (long long)(y - C.y) * (y - C.y);
    if ((long long)(r - C.r) * (r - C.r) >= d2) return 1;
    return 0;
  }
} cir[maxn];
int n;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) cir[i].input();
  for (int i = 0; i < n; i++) par[i] = -1;
  sort(cir, cir + n);
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++)
      if (cir[j].inner(cir[i])) {
        par[i] = j;
        break;
      }
  for (int i = n - 1; i >= 0; i--)
    if (par[i] == -1)
      h[i] = 0;
    else
      h[i] = h[par[i]] ^ 1;
  long long ans = 0;
  for (int i = n - 1; i >= 0; i--) {
    if (par[i] == -1) {
      ans += (long long)cir[i].r * cir[i].r;
      cnt[i] = 1;
      continue;
    } else {
      int x1 = cnt[par[i]] ^ 1;
      int x2 = h[i] ^ cnt[par[i]] ^ 1;
      if (x1 == 0 && x2 == 0)
        cnt[i] = x1, ans -= (long long)cir[i].r * cir[i].r;
      else {
        if (x1)
          cnt[i] = x1;
        else
          cnt[i] = x2;
        ans += (long long)cir[i].r * cir[i].r;
      }
    }
  }
  printf("%.20Lf\n", pi * ans);
  return 0;
}
