#include <bits/stdc++.h>
using namespace std;
const double PI =
    3.1415926535897932384614159265358979323846264338327950288419716939937510582097494459230781640628620;
void doRoutine() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
ifstream fin("/home/max/user/alg/codeforces_clion/input.txt");
ofstream fout("/home/max/user/alg/codeforces_clion/output.txt");
const double inf = 1000000000000000000;
struct Circle {
  int64_t x, y, r;
  int64_t id;
  Circle(int64_t x = 0, int64_t y = 0, int64_t r = 0, int64_t id = 0)
      : x(x), y(y), r(r), id(id) {}
  double square() { return PI * (double)(r * r); }
};
double hypot(int64_t x, int64_t y) {
  return sqrt((double)(x * x) + (double)(y * y));
}
bool contains(Circle a, Circle b) {
  return hypot(a.x - b.x, a.y - b.y) + b.r <= a.r;
}
void dfs(int64_t v, vector<bool> &used, vector<double> &wt,
         vector<vector<vector<double> > > &dp, vector<vector<int64_t> > &g) {
  used[v] = true;
  int64_t p = -1;
  for (auto u : g[v]) {
    if (!used[u]) {
      dfs(u, used, wt, dp, g);
    } else {
      p = u;
    }
  }
  for (int64_t c1 = 0; c1 < 2; ++c1) {
    for (int64_t c2 = 0; c2 < 2; ++c2) {
      for (int64_t c = 0; c < 2; ++c) {
        double cur_val = wt[v];
        if (c == 0 && c1 == 1 || c == 1 && c2 == 1) {
          cur_val = -wt[v];
        }
        for (auto u : g[v]) {
          if (u != p) {
            int64_t new_c1 = c1, new_c2 = c2;
            if (c == 0) {
              new_c1 = 1 - new_c1;
            } else if (c == 1) {
              new_c2 = 1 - new_c2;
            }
            cur_val += dp[u][new_c1][new_c2];
          }
        }
        dp[v][c1][c2] = max(dp[v][c1][c2], cur_val);
      }
    }
  }
}
signed main() {
  doRoutine();
  int64_t n;
  cin >> n;
  vector<Circle> c(n);
  vector<double> wt(n);
  for (int64_t i = 0; i < n; ++i) {
    cin >> c[i].x >> c[i].y >> c[i].r;
    c[i].id = i;
    wt[i] = c[i].square();
  }
  vector<vector<int64_t> > g(n);
  vector<int64_t> pow_in(n);
  for (int64_t v = 0; v < n; ++v) {
    double min_s = inf;
    int64_t p = -1;
    for (int64_t u = 0; u < n; ++u) {
      if (u != v) {
        if (contains(c[u], c[v]) && c[u].square() < min_s) {
          min_s = c[u].square();
          p = u;
        }
      }
    }
    if (p != -1) {
      g[p].push_back(v);
      pow_in[v] = 1;
    }
  }
  vector<vector<vector<double> > > dp(
      n, vector<vector<double> >(2, vector<double>(2, -inf)));
  vector<bool> used(n);
  for (int64_t v = 0; v < n; ++v) {
    if (pow_in[v] == 0) {
      dfs(v, used, wt, dp, g);
    }
  }
  double ans = 0;
  for (int64_t v = 0; v < n; ++v) {
    if (pow_in[v] == 0) {
      ans += dp[v][0][0];
    }
  }
  cout.precision(20);
  cout << ans << endl;
  return 0;
}
