#include <bits/stdc++.h>
using namespace std;
template <typename P, unsigned long long int mod>
class Mod {
 public:
  Mod() : v_() {}

 public:
  template <typename V>
  P& operator=(const V&& rv) {
    static_assert(std::is_integral<V>::value, "should be integral type");
    v_ = rv;
    return v_;
  }
  template <typename V>
  P& operator+=(const V&& rv) {
    static_assert(std::is_integral<V>::value, "should be integral type");
    v_ += rv;
    return v_;
  }

 private:
  P v_;
};
const int sz = 1e3 + 10;
const double pi = 3.141592653589793238462643383279502884L;
double area(tuple<double, double, double>& x) {
  return get<2>(x) * get<2>(x) * pi;
}
bool in(tuple<double, double, double>& a, tuple<double, double, double>& b) {
  double x = fabs(get<0>(a) - get<0>(b));
  double y = fabs(get<1>(a) - get<1>(b));
  return sqrt(x * x + y * y) + get<2>(b) <= get<2>(a);
}
bool ind[sz];
vector<int> edge[sz];
double dp[sz][2][2];
const double inf = -1e15;
vector<tuple<double, double, double>> cs;
double DFS(int n, int s1, int s2) {
  if (dp[n][s1][s2] != inf) {
    return dp[n][s1][s2];
  }
  double t1 = (s1 % 2 == 1) ? -area(cs[n]) : area(cs[n]);
  for (int i = 0; i < edge[n].size(); ++i) {
    t1 += DFS(edge[n][i], s1 ^ 1, s2);
  }
  double t2 = (s2 % 2 == 1) ? -area(cs[n]) : area(cs[n]);
  for (int i = 0; i < edge[n].size(); ++i) {
    t2 += DFS(edge[n][i], s1, s2 ^ 1);
  }
  double M = max(t1, t2);
  dp[n][s1][s2] = M;
  return M;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  cs.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> get<0>(cs[i]) >> get<1>(cs[i]) >> get<2>(cs[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] = inf;
      }
    }
  }
  sort(cs.begin(), cs.end(),
       [](tuple<double, double, double>& a, tuple<double, double, double>& b) {
         return area(a) < area(b);
       });
  for (int i = 0; i < n; ++i) {
    for (int j = i + 1; j < n; ++j) {
      if (in(cs[j], cs[i])) {
        edge[j].push_back(i);
        ind[i] = true;
        break;
      }
    }
  }
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    if (ind[i] == false) {
      ans += DFS(i, 0, 0);
    }
  }
  cout << fixed << setprecision(15) << ans << endl;
}
