#include <bits/stdc++.h>
using namespace std;
vector<int> x;
vector<int> y;
vector<int> r;
vector<int> dads;
const double pi = acos(-1.0);
int belong(int i, int j) {
  long long dis = ((long long)x[i] - x[j]) * (x[i] - x[j]) +
                  ((long long)y[i] - y[j]) * (y[i] - y[j]);
  long long ri = (long long)r[i] * r[i];
  long long rj = (long long)r[j] * r[j];
  if (dis >= ri + rj) return 0;
  if (r[i] > r[j]) return -1;
  return 1;
}
int main() {
  int n;
  cin >> n;
  x = vector<int>(n, 0);
  y = vector<int>(n, 0);
  r = vector<int>(n, 0);
  dads = vector<int>(n, 0);
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> r[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int tmp = belong(i, j);
      if (tmp == 0) continue;
      if (tmp == 1)
        dads[i]++;
      else
        dads[j]++;
    }
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    if (dads[i] == 0 || dads[i] % 2 == 1)
      ans += (long long)r[i] * r[i];
    else
      ans -= (long long)r[i] * r[i];
  }
  double ret = ans * pi;
  printf("%.8f\n", ret);
  return 0;
}
