#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000 + 5;
long double sizes[MAX_N];
vector<int> graph[MAX_N];
int depth[MAX_N];
long double dp[MAX_N][2][2];
void dfs(int v) {
  long double children[2][2] = {{0.0}};
  for (int u : graph[v]) {
    dfs(u);
    for (int i = 0; i < 2; ++i) {
      for (int j = 0; j < 2; ++j) {
        children[i][j] += dp[u][i][j];
      }
    }
  }
  for (int i = 0; i < 2; ++i) {
    for (int j = 0; j < 2; ++j) {
      dp[v][i][j] = max(children[1 - i][j] + sizes[v] * (1 - 2 * i),
                        children[i][1 - j] + sizes[v] * (1 - 2 * j));
    }
  }
}
bool compare(pair<pair<long long, long long>, long long> one,
             pair<pair<long long, long long>, long long> other) {
  return one.second < other.second;
}
int main() {
  int n;
  cin >> n;
  vector<pair<pair<long long, long long>, long long>> circles(n);
  for (int i = 0; i < n; ++i) {
    long long x, y, r;
    cin >> x >> y >> r;
    circles[i] = {{x, y}, r};
  }
  sort(circles.begin(), circles.end(), compare);
  reverse(circles.begin(), circles.end());
  for (int i = 0; i < n; ++i) {
    sizes[i] = 3.14159265358979323846 * circles[i].second * circles[i].second;
    for (int j = i - 1; j >= 0; --j) {
      long long dx2 = (circles[i].first.first - circles[j].first.first) *
                      (circles[i].first.first - circles[j].first.first);
      long long dy2 = (circles[i].first.second - circles[j].first.second) *
                      (circles[i].first.second - circles[j].first.second);
      if (dx2 + dy2 < circles[j].second * circles[j].second) {
        graph[j].emplace_back(i);
        depth[i] = depth[j] + 1;
        break;
      }
    }
  }
  long double answer = 0;
  for (int i = 0; i < n; ++i) {
    if (depth[i] == 0) {
      dfs(i);
      answer += dp[i][0][0];
    }
  }
  cout << fixed << setprecision(15) << answer << '\n';
}
