#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-9, PI = acos(-1);
struct cr {
  double x;
  double y;
  double r;
  cr(double x, double y, double r) {
    this->x = x;
    this->y = y;
    this->r = r;
  }
  bool operator<(const cr& c) const { return r > c.r + eps; }
};
bool ok(cr a, cr b) {
  double d = hypot(a.x - b.x, a.y - b.y);
  if (d + eps < a.r || abs(d - a.r) < b.r)
    return true;
  else
    return false;
}
int n;
double x, y, r;
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  vector<cr> v;
  while (n--) {
    cin >> x >> y >> r;
    v.push_back(cr(x, y, r));
  }
  sort(v.begin(), v.end());
  double ans = 0;
  vector<int> a, b;
  for (int i = 0; i < v.size(); ++i) {
    int f = 0, s = 0;
    for (auto it : a)
      if (ok(v[it], v[i])) f++;
    for (auto it : b)
      if (ok(v[it], v[i])) s++;
    if (f % 2 == 0) {
      a.push_back(i);
      ans += v[i].r * v[i].r * PI;
    } else if (s % 2 == 0) {
      b.push_back(i);
      ans += v[i].r * v[i].r * PI;
    } else {
      ans -= v[i].r * v[i].r * PI;
      a.push_back(i);
    }
  }
  cout << setprecision(9) << fixed << ans;
  return 0;
}
