#include <bits/stdc++.h>
using namespace std;
struct circ {
  double x, y, area, rad;
  int polar = 0;
  int par;
};
int n;
circ arr[1005];
double dist(int i, int ii) {
  return sqrt((arr[i].x - arr[ii].x) * (arr[i].x - arr[ii].x) +
              (arr[i].y - arr[ii].y) * (arr[i].y - arr[ii].y));
}
bool sorter(circ c1, circ c2) { return c1.area > c2.area; }
int main() {
  memset(arr, -1, sizeof(arr));
  cin >> n;
  for (int i = 0; i < n; i++) {
    double a, b, c;
    cin >> a >> b >> c;
    arr[i].x = a;
    arr[i].y = b;
    arr[i].rad = c;
    arr[i].area = c;
  }
  sort(arr, arr + n, sorter);
  for (int i = 0; i < n; i++) {
    for (int e = i - 1; e >= 0; e--) {
      if (arr[i].rad + arr[e].rad > dist(i, e)) {
        arr[i].par = e;
        break;
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < n; i++) {
    int dpth = 0;
    int nxt = i;
    while (arr[nxt].par != -1) {
      dpth++;
      nxt = arr[nxt].par;
    }
    if (dpth <= 1) {
      ans += arr[i].rad * arr[i].rad;
    } else {
      if (dpth % 2 == 0) {
        ans -= arr[i].rad * arr[i].rad;
      } else
        ans += arr[i].rad * arr[i].rad;
    }
  }
  cout << fixed << setprecision(12) << ans * 3.14159265358;
  return 0;
}
