#include <bits/stdc++.h>
using namespace std;
inline long long sqr(long long x) { return (x * x); }
inline long long dist(pair<long long, long long> a,
                      pair<long long, long long> b) {
  return sqr(a.first - b.first) + sqr(a.second - b.second);
}
inline long long func(int i) {
  if (i < 2 || i & 1) return 1;
  return -1;
}
int main() {
  int n;
  scanf("%d", &n);
  vector<pair<long long, pair<long long, long long> > > a;
  long long x, y, r;
  for (int i = 0; i < n; i++) {
    scanf("%lld %lld %lld", &x, &y, &r);
    a.push_back(make_pair(r, make_pair(x, y)));
  }
  int deg = 0;
  double answer = 0.0;
  sort(a.begin(), a.end());
  for (int i = 0; i < n; i++) {
    deg = 0;
    for (int j = i + 1; j < n; j++)
      if (dist(a[i].second, a[j].second) <= sqr(a[j].first)) deg++;
    answer += (double)acos(-1) * sqr(a[i].first) * func(deg);
  }
  printf("%.20lf\n", answer);
  return 0;
}
