#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1);
struct Circle {
  long long r, x, y;
  bool operator<(const Circle& rhs) const { return r < rhs.r; }
} circle[1010];
inline bool check(Circle& a, Circle& b) {
  return a.r * a.r >= (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y);
}
int par[1010];
vector<int> g[1010];
long long ans;
void dfs(int u, int dep) {
  if (dep & 1) {
    if (dep == 1)
      ans += circle[u].r * circle[u].r;
    else
      ans -= circle[u].r * circle[u].r;
  } else {
    ans += circle[u].r * circle[u].r;
  }
  for (int& v : g[u]) {
    dfs(v, dep + 1);
  }
}
int main() {
  int N;
  long long x, y, r;
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%lld%lld%lld", &x, &y, &r);
    circle[i] = (Circle){r, x, y};
  }
  sort(circle + 1, circle + 1 + N);
  memset(par, -1, sizeof par);
  for (int i = 1; i <= N; i++) {
    for (int j = 1; j < i; j++) {
      if (par[j] == -1 && check(circle[i], circle[j])) {
        g[i].push_back(j);
        par[j] = i;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    if (par[i] == -1) {
      dfs(i, 1);
    }
  }
  printf("%.13lf\n", (double)ans * PI);
  return 0;
}
