#include <bits/stdc++.h>
using namespace std;
const int N = 1511, M = 3010100, inf = 0x7fffffff;
const long long llinf = 0x7fffffff7fffffffll;
long long x[N], y[N], r[N];
long long c[N];
double dist(int i, int j) {
  return sqrtl((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}
double area(int i) {
  return 3.14159265358979323846264338327950288 * r[i] * r[i];
}
int main(int argc, const char* argv[]) {
  int n;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> x[i] >> y[i] >> r[i];
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = 1; j <= n; ++j) {
      if (r[i] < r[j] && dist(i, j) <= r[j]) {
        ++c[i];
      }
    }
  }
  double sum = 0;
  for (int i = 1; i <= n; ++i) {
    if (c[i] == 0) {
      sum += area(i);
    } else if (c[i] % 2 == 1) {
      sum += area(i);
    } else {
      sum -= area(i);
    }
  }
  printf("%.10f", sum);
  return 0;
}
