#include <bits/stdc++.h>
using namespace std;
int num[1100], x[1100], y[1100], r[1100], i, j, n, m, k;
const double e = 1e-7;
double pi = acos(-1);
double ans;
long long sqr(int x) { return 1ll * x * x; }
double dis(int i, int j) { return sqrt(sqr(x[i] - x[j]) + sqr(y[i] - y[j])); }
int main() {
  scanf("%d", &n);
  for (i = 1; i <= n; i++) scanf("%d%d%d", &x[i], &y[i], &r[i]);
  for (i = 1; i <= n; i++)
    for (j = 1; j <= n; j++)
      if (i != j && r[j] > r[i]) {
        double d = dis(i, j);
        double dr = r[j] - r[i];
        if (d - dr <= e) num[i]++;
      }
  for (i = 1; i <= n; i++)
    if (num[i] <= 1)
      ans += pi * r[i] * r[i];
    else if (num[i] % 2 == 0)
      ans -= pi * r[i] * r[i];
    else
      ans += pi * r[i] * r[i];
  printf("%.8lf", ans);
}
