#include <bits/stdc++.h>
using namespace std;
const int M = (int)1e9 + 7;
double PI = 3.1415926535897932384626433832795028841971693;
bool inside(double x1, double y1, double r1, double x2, double y2, double r2) {
  if (r1 >= r2) return false;
  double dis = sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1));
  if (dis < r2)
    return true;
  else
    return false;
}
int main() {
  cout.precision(15);
  cout.setf(ios::fixed);
  int n;
  cin >> n;
  vector<double> x(n), y(n), r(n);
  vector<int> cnt(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++) {
    for (int j = 0; j < n; j++)
      if (i != j) cnt[i] += inside(x[i], y[i], r[i], x[j], y[j], r[j]);
  }
  for (int i = 0; i < n; i++)
    if (cnt[i] == 0 || cnt[i] == 1 || cnt[i] % 2 == 1)
      ans += (r[i] * r[i]);
    else
      ans -= (r[i] * r[i]);
  ans = PI * ans;
  cout << ans << '\n';
}
