#include <bits/stdc++.h>
using namespace std;
vector<pair<long long int, pair<long long int, long long int>>> v;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int n, mark[1005] = {0};
  long long int x, y, r, area = 0;
  cin >> n;
  for (int i = 0; i < int(n); ++i)
    cin >> x >> y >> r, v.push_back(make_pair(r, make_pair(x, y)));
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  for (int i = 0; i < int(n - 1); ++i) {
    r = (v[i].first) * (v[i].first);
    for (int j = i + 1; j < n; j++) {
      x = (v[i].second.first - v[j].second.first) *
          (v[i].second.first - v[j].second.first);
      y = (v[i].second.second - v[j].second.second) *
          (v[i].second.second - v[j].second.second);
      if (x + y <= r) mark[j] = max(mark[j], i + 1);
    }
  }
  list<pair<int, int>> q;
  q.push_back(make_pair(0, 1));
  while (!q.empty()) {
    pair<int, int> m = q.front();
    for (int i = 0; i < int(n); ++i)
      if (m.first == mark[i]) {
        q.push_back(make_pair(i + 1, m.second + 1));
        r = (v[i].first) * (v[i].first);
        if (m.second % 2 == 0 || m.second == 1)
          area += r;
        else
          area -= r;
      }
    q.pop_front();
  }
  double arr = acos(-1) * (double)area;
  cout << setprecision(10) << fixed << arr;
  return 0;
}
