#include <bits/stdc++.h>
using namespace std;
inline void out(int a) { printf("%d\n", a); }
inline void out(int a, int b) { printf("%d %d\n", a, b); }
inline void outf(double a) { printf("%3.lf\n", a); }
inline void outf(double a, double b) { printf("%3.lf %3.lf\n", a, b); }
inline void base() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
}
bool cmp(pair<pair<long long, long long>, long long> a,
         pair<pair<long long, long long>, long long> b) {
  return a.second > b.second;
}
long long euc(pair<long long, long long> a, pair<long long, long long> b) {
  return (a.first - b.first) * (a.first - b.first) +
         (a.second - b.second) * (a.second - b.second);
}
int par[1005];
vector<long long> child[1005];
long long area[1005];
int col[1005];
void paint(int idx, int co) {
  col[idx] = co;
  for (int(i) = 0; (i) < ((int)child[idx].size()); (i)++) {
    paint(child[idx][i], !co);
  }
}
int main() {
  base();
  cout << fixed << setprecision(9);
  memset(par, -1, sizeof par);
  int n;
  cin >> n;
  vector<pair<pair<long long, long long>, long long> > data;
  for (int(i) = 0; (i) < (n); (i)++) {
    long long a, b, c;
    cin >> a >> b >> c;
    data.push_back(pair<pair<long long, long long>, long long>(
        pair<long long, long long>(a, b), c));
  }
  sort(data.begin(), data.end(), cmp);
  for (int(i) = (n - 1); (i) >= (0); (i)--) {
    int j = i - 1;
    area[i] = data[i].second * data[i].second;
    while (j >= 0) {
      long long dist = euc(data[i].first, data[j].first);
      long long d = data[j].second * data[j].second;
      if (dist <= d) {
        par[i] = j;
        child[j].push_back(i);
        break;
      }
      j--;
    }
  }
  for (int(i) = 0; (i) < (n); (i)++)
    if (par[i] == -1) paint(i, 0);
  long long ans = 0;
  for (int(i) = 0; (i) < (n); (i)++) {
    if (par[i] == -1)
      ans += area[i];
    else if (col[i] == 0)
      ans -= area[i];
    else
      ans += area[i];
  }
  cout << (double)ans * 2.0 * acos(0.0) << endl;
  return 0;
}
