#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1);
int n, fa[1005];
vector<int> v[1005];
double dp[1005], x[1005], y[1005], r[1005], ans;
double sqr(double x) { return x * x; }
void dfs(int now, int deep) {
  dp[deep] += pi * r[now] * r[now];
  for (auto &i : v[now]) dfs(i, deep + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%lf %lf %lf", x + i, y + i, r + i);
  }
  for (int i = 1; i <= n; ++i)
    for (int j = 1; j <= n; ++j)
      if (i != j && sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j])) + r[i] <= r[j] &&
          (fa[i] == 0 || r[fa[i]] > r[j]))
        fa[i] = j;
  for (int i = 1; i <= n; ++i) v[fa[i]].push_back(i);
  for (int i = 1; i <= n; ++i)
    if (fa[i] == 0) dfs(i, 1);
  ans = dp[1];
  for (int i = 2; i <= n; ++i) {
    if (i & 1)
      ans -= dp[i];
    else
      ans += dp[i];
  }
  printf("%.10lf\n", ans);
}
