#include <bits/stdc++.h>
using namespace std;
const long double pi = acos(-1);
int n, a[1005];
long long x[1005], y[1005], r[1005];
long double ans;
inline void read(long long &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = 10 * x + c - '0';
    c = getchar();
  }
  x *= f;
}
bool judge(int a, int b) {
  long double dis =
      sqrt(((x[a] - x[b]) * (x[a] - x[b])) + ((y[a] - y[b]) * (y[a] - y[b])));
  return dis + r[a] <= r[b] + (1e-6);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    read(x[i]);
    read(y[i]);
    read(r[i]);
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++)
      if (i != j) a[i] += judge(i, j);
  long long tmp = 0;
  for (int i = 1; i <= n; i++)
    if (a[i] <= 1 || a[i] % 2 == 1)
      tmp += ((r[i]) * (r[i]));
    else
      tmp -= ((r[i]) * (r[i]));
  ans = tmp * pi;
  printf("%.8lf", (double)ans);
  return 0;
}
