#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3f3f3f3f;
const double PI = 3.14159265358979323846;
const int MAXN = 1000005;
int n, x[MAXN], y[MAXN], r[MAXN];
int d[MAXN];
vector<int> G[MAXN];
inline double dis(double x1, double y1, double x2, double y2) {
  double d = (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
  return sqrt(d);
}
int judge(int i, int j) {
  if (r[i] + r[j] <= dis(x[i], y[i], x[j], y[j]))
    return 0;
  else if (r[i] > r[j])
    return 1;
  else if (r[j] > r[i])
    return 2;
}
double calc(int i) { return PI * r[i] * r[i]; }
double ans = 0;
void dfs(int i, int dis) {
  if (d[i] >= dis)
    return;
  else
    d[i] = dis;
  for (int v : G[i]) {
    dfs(v, dis + 1);
  }
}
int main() {
  scanf("%d", &n);
  for (int i = (1); i < (n + 1); i++) scanf("%d%d%d", x + i, y + i, r + i);
  for (int i = (1); i < (n + 1); i++) {
    for (int j = (i + 1); j < (n + 1); j++) {
      int status = judge(i, j);
      if (status == 1) {
        G[i].push_back(j);
      } else if (status == 2) {
        G[j].push_back(i);
      }
    }
  }
  for (int i = (1); i < (n + 1); i++) {
    if (!d[i]) dfs(i, 1);
  }
  for (int i = (1); i < (n + 1); i++) {
    if (d[i] <= 2)
      ans += calc(i);
    else if (d[i] & 1)
      ans -= calc(i);
    else
      ans += calc(i);
  }
  printf("%.11f\n", ans);
}
