#include <bits/stdc++.h>
using std::max;
const int N = 1050;
struct Circle {
  long long x, y, r;
  bool operator<(const Circle &c) const { return r > c.r; }
} cirs[N];
inline bool in(const Circle &a, const Circle &b) {
  long long xx = a.x - b.x, yy = a.y - b.y;
  return b.r * b.r >= xx * xx + yy * yy;
}
long long f[N][2][2];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i)
    scanf(
        "%I64d"
        "%I64d"
        "%I64d",
        &cirs[i].x, &cirs[i].y, &cirs[i].r);
  std::sort(cirs, cirs + n);
  long long ans = 0;
  for (int i = n - 1; ~i; --i) {
    long long f00 = f[i][0][0], f01 = f[i][0][1], f10 = f[i][1][0],
              f11 = f[i][1][1];
    long long area = cirs[i].r * cirs[i].r;
    f[i][0][0] = area + max(f01, f10);
    f[i][0][1] = max(area + f11, -area + f00);
    f[i][1][0] = max(-area + f00, area + f11);
    f[i][1][1] = -area + max(f01, f10);
    int j;
    for (j = i - 1; ~j; --j)
      if (in(cirs[i], cirs[j])) {
        for (int k1 = 0; k1 < 2; ++k1)
          for (int k2 = 0; k2 < 2; ++k2) f[j][k1][k2] += f[i][k1][k2];
        break;
      }
    if (j < 0) ans += f[i][0][0];
  }
  printf("%.8lf\n", ans * acos(-1.0));
  return 0;
}
