#include <bits/stdc++.h>
using namespace std;
pair<long long, pair<long long, long long> > c[1000];
int p[1000];
vector<int> g[1000];
long long dp[1000][2][2];
int n;
bool is_in(pair<long long, pair<long long, long long> > a,
           pair<long long, pair<long long, long long> > b) {
  if (sqrt((a.second.first - b.second.first) *
               (a.second.first - b.second.first) +
           (a.second.second - b.second.second) *
               (a.second.second - b.second.second)) +
          a.first <=
      b.first) {
    return true;
  }
  return false;
}
long long solve(int act, int a, int b, int pa) {
  if (dp[act][a][b] != -1) return dp[act][a][b];
  long long op1, op2;
  if (a % 2 == 0) {
    op1 = (double)c[act].first * c[act].first;
    for (int i = 0; i < (int)g[act].size(); i++) {
      if (g[act][i] != pa) op1 += solve(g[act][i], 1, b, act);
    }
  } else {
    op1 = -c[act].first * c[act].first;
    for (int i = 0; i < (int)g[act].size(); i++) {
      if (g[act][i] != pa) op1 += solve(g[act][i], 0, b, act);
    }
  }
  if (b % 2 == 0) {
    op2 = c[act].first * c[act].first;
    for (int i = 0; i < (int)g[act].size(); i++) {
      if (g[act][i] != pa) op2 += solve(g[act][i], a, 1, act);
    }
  } else {
    op2 = -c[act].first * c[act].first;
    for (int i = 0; i < (int)g[act].size(); i++) {
      if (g[act][i] != pa) op2 += solve(g[act][i], a, 0, act);
    }
  }
  return dp[act][a][b] = max(op1, op2);
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++)
    scanf("%lld%lld%lld", &c[i].second.first, &c[i].second.second, &c[i].first);
  memset(p, -1, sizeof(p));
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      if (j != i && is_in(c[i], c[j]) &&
          (p[i] == -1 || c[p[i]].first > c[j].first))
        p[i] = j;
  for (int i = 0; i < n; i++)
    if (p[i] != -1) {
      g[p[i]].push_back(i);
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < 2; j++)
      for (int k = 0; k < 2; k++) dp[i][j][k] = -1;
  double ans = 0;
  for (int i = 0; i < n; i++)
    if (p[i] == -1) {
      ans += solve(i, 0, 0, -1);
    }
  printf("%.9f\n", ((double)ans) * 3.14159265359);
  return 0;
}
