#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int dx[8] = {1, -1, 0, 0, -1, -1, 1, 1};
int dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
int gcd(int a, int b) {
  if (b == 0)
    return a;
  else
    return gcd(b, a % b);
}
bool cmp(vector<long long> a, vector<long long> b) { return a[2] > b[2]; }
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<vector<long long>> v;
  for (long long i = 0; i < n; i++) {
    long long a, b, c;
    cin >> a >> b >> c;
    v.push_back({a, b, c});
  }
  sort((v).begin(), (v).end(), cmp);
  vector<int> adj[n + 1];
  for (int i = 0; i < n; i++) {
    for (int j = i - 1; j >= 0; j--) {
      long double dis = (v[j][0] - v[i][0]) * (v[j][0] - v[i][0]) +
                        (v[j][1] - v[i][1]) * (v[j][1] - v[i][1]);
      long double dis1 = v[i][2] + v[j][2];
      if (dis1 * dis1 <= dis) {
        continue;
      } else {
        adj[i].push_back(j);
        adj[j].push_back(i);
        break;
      }
    }
  }
  vector<int> vis(n, 0);
  vector<int> dis(n, 0);
  for (int i = 0; i < n; i++) {
    if (vis[i] == 0) {
      queue<int> q;
      q.push(i);
      vis[i] = 1;
      dis[i] = 1;
      while (!q.empty()) {
        auto a = q.front();
        q.pop();
        for (auto i : adj[a]) {
          if (vis[i] == 0) {
            vis[i] = 1;
            dis[i] = dis[a] + 1;
            q.push(i);
          }
        }
      }
    }
  }
  long double ans = 0;
  for (int i = 0; i < n; i++) {
    if (dis[i] % 2 == 0 || dis[i] == 1) {
      ans =
          ans +
          3.141592653589793238462643383279502884197169399375105820974944592307816406286 *
              v[i][2] * v[i][2];
    } else {
      ans =
          ans -
          3.141592653589793238462643383279502884197169399375105820974944592307816406286 *
              v[i][2] * v[i][2];
    }
  }
  cout << setprecision(15) << ans << '\n';
}
