#include <bits/stdc++.h>
using namespace std;
long long n, x[1111], y[1111], r[1111], deg[1111], ans;
vector<int> child[1111], tmp;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = (0); i <= ((int)(n)-1); i++) cin >> x[i] >> y[i] >> r[i];
  for (int i = (0); i <= ((int)(n)-1); i++)
    for (int j = (0); j <= ((int)(n)-1); j++)
      if (r[i] > r[j]) {
        if ((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]) <=
            (r[i]) * (r[i]))
          deg[j]++, child[i].push_back(j);
      }
  for (int i = (0); i <= ((int)(n)-1); i++)
    if (!deg[i]) tmp.push_back(i);
  for (auto i : tmp) {
    for (auto nex : child[i]) deg[nex]--;
  }
  for (int i = (0); i <= ((int)(n)-1); i++) {
    if (deg[i] & 1)
      ans -= (r[i]) * (r[i]);
    else
      ans += (r[i]) * (r[i]);
  }
  cout << setprecision(11) << ans * acos(-1);
}
