#include <bits/stdc++.h>
using namespace std;
const long double Pi = 3.14159265359;
long long t[1005], arie[1005], c[1005], r[1005], part[1005];
long long n, ans;
vector<int> G[1005];
struct Point {
  long long x, y;
};
struct Circle {
  Point P;
  long long r;
} v[1005];
bool comp(Circle A, Circle B) { return A.r > B.r; }
long long dist(Point A, Point B) {
  long long d1 = A.x - B.x;
  long long d2 = A.y - B.y;
  long long aux1 = (long long)d1 * (long long)d1;
  long long aux2 = (long long)d2 * (long long)d2;
  return aux1 + aux2;
}
bool verif(int p1, int p2) {
  long long raza = (long long)v[p1].r * (long long)v[p1].r;
  if (dist(v[p1].P, v[p2].P) <= raza) return true;
  return false;
}
void dfs(int node, int tata) {
  t[node] = tata;
  for (vector<int>::iterator it = G[node].begin(); it != G[node].end(); ++it) {
    if (*it != tata) {
      int p = *it, ok = 0;
      t[p] = node;
      while (t[p] != 0) {
        if (ok == 0) {
          if (c[t[p]] == -1) {
            c[*it] = 1;
            ans += arie[*it];
            part[*it] = part[t[p]];
            break;
          } else {
            ok = part[t[p]];
          }
        } else {
          if (part[t[p]] != ok) {
            if (c[t[p]] == 1) {
              c[*it] = -1;
              ans -= arie[*it];
              part[*it] = part[t[p]];
              break;
            } else {
              c[*it] = 1;
              ans += arie[*it];
              part[*it] = part[t[p]];
              break;
            }
          }
        }
        p = t[p];
      }
      if (t[p] == 0) {
        if (!ok)
          part[*it] = 1;
        else
          part[*it] = 3 - ok;
        c[*it] = 1;
        ans += arie[*it];
      }
      dfs(*it, node);
    }
  }
}
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> v[i].P.x >> v[i].P.y >> v[i].r;
  }
  sort(v + 1, v + n + 1, comp);
  for (int i = 1; i <= n; ++i) {
    arie[i] = v[i].r * v[i].r;
  }
  for (int i = 1; i <= n; ++i) {
    for (int j = i - 1; j >= 1; --j) {
      if (verif(j, i) == 1) {
        G[j].push_back(i);
        r[i] = 1;
        break;
      }
    }
  }
  c[0] = -1;
  for (int i = 1; i <= n; ++i) {
    if (r[i] == 0) {
      ans += arie[i];
      part[i] = 1;
      t[i] = 0;
      c[i] = 1;
      dfs(i, 0);
    }
  }
  long double Ans = Pi * (long double)ans;
  cout << setprecision(9) << fixed << Ans;
  return 0;
}
