#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000 + 3;
const double PI = acos(-1.0);
int n, x[MAX_N], y[MAX_N], r[MAX_N];
inline double area(int r) { return PI * r * r; }
inline long long sqr(int x) { return (long long)x * x; }
inline bool check(int i, int j) {
  if (r[i] >= r[j]) return false;
  return (sqr(x[i] - x[j]) + sqr(y[i] - y[j])) <= sqr(r[j]);
}
int main() {
  cin >> n;
  for (int i = 0; i < n; ++i) cin >> x[i] >> y[i] >> r[i];
  double ans = 0;
  for (int i = 0; i < n; ++i) {
    int cnt = 0;
    for (int j = 0; j < n; ++j)
      if (i != j)
        if (check(i, j)) ++cnt;
    int sign = 1;
    if (cnt == 0)
      sign = 1;
    else if (cnt == 1)
      sign = 1;
    else
      sign = (cnt & 1) ? 1 : -1;
    ans += sign * area(r[i]);
  }
  printf("%.10f\n", ans);
  return 0;
}
