#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
struct node {
  double r, x, y;
  double area() { return pi * r * r; }
} s[1010];
int vis[1010];
int cmp(node a, node b) {
  if (a.r == b.r) {
    if (a.x == b.x) return a.y < b.y;
    return a.x < b.x;
  }
  return a.r > b.r;
}
int han(node a, node b) {
  return (a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y) <
         (a.r + b.r) * (a.r + b.r);
}
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%lf%lf%lf", &s[i].x, &s[i].y, &s[i].r);
  }
  sort(s + 1, s + n + 1, cmp);
  for (int i = 1; i <= n; i++) {
    for (int j = i + 1; j <= n; j++) {
      if (han(s[i], s[j])) vis[j]++;
    }
  }
  double sum = 0;
  for (int i = 1; i <= n; i++) {
    if (!vis[i])
      sum += s[i].area();
    else if (vis[i] & 1) {
      sum += s[i].area();
    } else
      sum -= s[i].area();
  }
  printf("%.7f\n", sum);
}
