#include <bits/stdc++.h>
using namespace std;
int n;
struct Circle {
  long long x, y, r;
} a[2000];
long long dist(const Circle &a, const Circle &b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
long long relation(const Circle &a, const Circle &b) {
  long long d = dist(a, b);
  if (d >= (a.r + b.r) * (a.r + b.r)) {
    return 0;
  }
  if (a.r > b.r) return 1;
  return -1;
}
vector<int> inner[2000];
int dp[2000];
int b[2000];
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%I64d", &a[i].x);
    scanf("%I64d", &a[i].y);
    scanf("%I64d", &a[i].r);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int tmp = relation(a[i], a[j]);
      if (tmp == 1) {
        inner[i].push_back(j);
      } else if (tmp == -1) {
        inner[j].push_back(i);
      }
    }
  }
  for (int i = 0; i < n; i++) {
    b[i] = i;
  }
  sort(b, b + n, [](const int &inta, const int &intb) {
    return inner[inta].size() > inner[intb].size();
  });
  for (int i = 0; i < n; i++) {
    for (int au : inner[b[i]]) {
      dp[au] = max(dp[au], dp[b[i]] + 1);
    }
  }
  double ansa = 0;
  for (int i = 0; i < n; i++) {
    if (dp[i] == 0 || dp[i] % 2 == 1) {
      ansa += 3.14159265358979323846 * a[i].r * a[i].r;
    } else {
      ansa -= 3.14159265358979323846 * a[i].r * a[i].r;
    }
  }
  printf("%.20f\n", ansa);
  return 0;
}
