#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
long long POW(long long a, long long b) {
  long long ret = 1;
  for (; b; b >>= 1, a = (a * a) % MOD)
    if (b & 1) ret = (ret * a) % MOD;
  return ret;
}
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
long long lcm(long long a, long long b) {
  if (a == 0 || b == 0) return a + b;
  return a * (b / gcd(a, b));
}
int dx[] = {0, -1, 1, 0}, dy[] = {1, 0, 0, -1};
int ddx[] = {0, 0, 1, 1, 1, -1, -1, -1}, ddy[] = {1, -1, 1, 0, -1, 1, 0, -1};
tuple<long long, long long, long long> a[1000];
int ind[1000];
vector<int> v[1000];
long long d[1000][2][2];
void go(int N) {
  long long t[2][2] = {0};
  for (int next : v[N]) {
    go(next);
    for (int(i) = (0); (i) <= (1); (i) += (1))
      for (int(j) = (0); (j) <= (1); (j) += (1)) t[i][j] += d[next][i][j];
  }
  for (int(i) = (0); (i) <= (1); (i) += (1))
    for (int(j) = (0); (j) <= (1); (j) += (1)) {
      d[N][i][j] =
          max(t[1 - i][j] + get<0>(a[N]) * get<0>(a[N]) * (i == 0 ? 1 : -1),
              t[i][1 - j] + get<0>(a[N]) * get<0>(a[N]) * (j == 0 ? 1 : -1));
    }
}
int main() {
  int n;
  scanf("%d", &n);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    long long x, y, r;
    scanf("%lld%lld%lld", &x, &y, &r);
    a[i] = tuple<long long, long long, long long>(r, x, y);
  }
  sort(a, a + n);
  for (int(i) = (0); (i) <= (n - 1); (i) += (1)) {
    long long x1, y1, r1;
    tie(r1, x1, y1) = a[i];
    for (int(j) = (i + 1); (j) <= (n - 1); (j) += (1)) {
      long long x2, y2, r2;
      tie(r2, x2, y2) = a[j];
      if ((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2) <=
          (r1 - r2) * (r1 - r2)) {
        v[j].push_back(i);
        ind[i]++;
        break;
      }
    }
  }
  long long ans = 0;
  for (int(i) = (0); (i) <= (n - 1); (i) += (1))
    if (ind[i] == 0) {
      go(i);
      ans += d[i][0][0];
    }
  printf("%.10f", (double)ans * 3.14159265358979323846264);
}
