#include <bits/stdc++.h>
using namespace std;
void SO() { cout << endl; }
template <typename S, typename... Strings>
void SO(S x, const Strings&... rest) {
  cout << x << ' ';
  SO(rest...);
}
template <typename T>
void trace(const char* name, T&& arg1) {
  cout << name << " : " << arg1 << endl;
}
template <typename T, typename... Args>
void trace(const char* names, T&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cout.write(names, comma - names) << " : " << arg1 << " | ";
  trace(comma + 1, args...);
}
const long double PI = 3.1415926535897932384626433832795;
const int v5 = 100000;
const int v9 = 1000000000;
const int v6 = 1000000;
inline long double ABS(long double a) {
  if (a < 0) return (-a);
  return a;
}
inline long double min(long double a, long double b, long double c) {
  return min(a, min(b, c));
}
inline long double max(long double a, long double b, long double c) {
  return max(a, max(b, c));
}
inline void AI(long double x[], long double n) {
  for (int i = 0; i < (n); ++i) cin >> (x[i]);
}
inline void VI(vector<long double>& arr, long double n) {
  for (int i = 0; i < (n); ++i) {
    long double x;
    cin >> (x);
    arr.push_back(x);
  };
}
const int AS = 4000001;
long double n, m, k, c = 0;
long double a[AS];
map<long double, vector<long double> > g;
long double inp[1001][3];
int tag[1001];
vector<pair<long double, int> > v;
string s;
long double dist(long double x1, long double y1, long double x2,
                 long double y2) {
  return sqrt(((y2 - y1) * (y2 - y1)) + ((x2 - x1) * (x2 - x1)));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> (n);
  for (long int i = (0); i < (n); ++i) {
    cin >> inp[i][0] >> inp[i][1] >> inp[i][2];
    v.push_back(make_pair(PI * inp[i][2] * inp[i][2], i));
  }
  sort(v.rbegin(), v.rend());
  ;
  for (long int i = (1); i < (n); ++i) {
    for (long int j = (i - 1); j >= (0); --j) {
      if (dist(inp[v[i].second][0], inp[v[i].second][1], inp[v[j].second][0],
               inp[v[j].second][1]) < inp[v[j].second][2]) {
        if (tag[v[j].second] == 2)
          tag[v[i].second] = 1;
        else
          tag[v[i].second] = (tag[v[j].second] + 1) % 3;
        break;
      }
    }
  }
  for (long int i = (0); i < (n); ++i) {
    c += ((tag[v[i].second] <= 1) ? v[i].first : (-1 * v[i].first));
  }
  cout << setprecision(20) << ABS(c) << "\n";
  return 0;
}
