#include <bits/stdc++.h>
using namespace std;
template <class A, class B>
A cvt(B x) {
  stringstream ss;
  ss << x;
  A y;
  ss >> y;
  return y;
}
double PI = acos(-1.0);
int n;
int p[1000];
double area[1000];
vector<int> ch[1000];
long long sqr(long long x) { return x * x; }
long long dist2(vector<int> &c1, vector<int> &c2) {
  return sqr(c1[1] - c2[1]) + sqr(c1[2] - c2[2]);
}
double f[1000][2][2];
void solve(int x) {
  for (int y : ch[x]) solve(y);
  for (int b = 0; b < (int)(2); b++)
    for (int a = 0; a < (int)(2); a++) {
      double before = (1 - b * 2) * area[x];
      for (int y : ch[x]) before += f[y][1 - b][a];
      double after = (1 - a * 2) * area[x];
      for (int y : ch[x]) after += f[y][b][1 - a];
      f[x][b][a] = max(before, after);
    }
}
int main() {
  scanf("%d", &n);
  vector<vector<int> > circ;
  for (int i = 0; i < (int)(n); i++) {
    vector<int> c(4);
    c[3] = i;
    scanf("%d %d %d", &c[1], &c[2], &c[0]);
    circ.push_back(c);
  }
  sort((circ).begin(), (circ).end());
  reverse((circ).begin(), (circ).end());
  for (int i = 0; i < (int)(n); i++) {
    p[i] = -1;
    for (int j = 0; j < (int)(i); j++) {
      if (dist2(circ[i], circ[j]) < sqr(circ[j][0])) p[i] = j;
    }
    if (p[i] != -1) ch[p[i]].push_back(i);
    area[i] = PI * sqr(circ[i][0]);
  }
  double s = 0;
  for (int i = 0; i < (int)(n); i++)
    if (p[i] == -1) {
      solve(i);
      s += f[i][0][0];
    }
  printf("%.11f\n", s);
  return 0;
}
