#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, pair<long long int, long long int> > > P;
int level[1007];
double ans = 0;
bool contains(pair<long long int, pair<long long int, long long int> > A,
              pair<long long int, pair<long long int, long long int> > B) {
  return (A.second.first - B.second.first) * (A.second.first - B.second.first) +
             (A.second.second - B.second.second) *
                 (A.second.second - B.second.second) <
         (A.first) * (A.first);
}
int main() {
  long long int i, j, k, l, m, n, x, y, z, a, b, r;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%lld", &x);
    scanf("%lld", &y);
    scanf("%lld", &r);
    P.push_back(make_pair(r, make_pair(x, y)));
  }
  sort(P.begin(), P.end());
  for (i = n - 1; i >= 0; i--) {
    for (j = n - 1; j > i; j--) {
      if (contains(P[j], P[i])) {
        level[i] = max(level[i], level[j] + 1);
      }
    }
    if (level[i] == 0) level[i] = 1;
  }
  for (i = 0; i < n; i++) {
    if (level[i] <= 2)
      ans += (P[i].first * P[i].first);
    else {
      if (level[i] % 2 == 1)
        ans -= (P[i].first * P[i].first);
      else
        ans += (P[i].first * P[i].first);
    }
  }
  printf("%.10lf\n", ans * 3.14159265358979);
  return 0;
}
