#include <bits/stdc++.h>
using namespace std;
struct point {
  long long x, y;
};
double getDist(point a, point b) {
  return sqrt(pow(1.0 * a.x - b.x, 2) + pow(1.0 * a.y - b.y, 2));
}
void enterPoint(point &a) { cin >> a.x >> a.y; }
struct ball {
  long long r;
  point p;
  long long getArea() { return r * r; }
};
vector<ball> balls;
vector<vector<long long> > tree;
vector<long long> c;
bool comp(ball a, ball b) { return a.r > b.r; }
long long a1 = 0, a2 = 0;
void dfs(long long u, long long h) {
  c[u] = 1;
  if (h == 0)
    a1 += balls[u].getArea();
  else if (h % 2 == 1)
    a2 += balls[u].getArea();
  else if (h % 2 == 0)
    a2 -= balls[u].getArea();
  for (long long i = 0; i < tree[u].size(); i++) {
    dfs(tree[u][i], h + 1);
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie();
  cout.tie();
  long long n;
  cin >> n;
  balls.resize(n);
  tree.resize(n);
  c.resize(n);
  for (long long i = 0; i < n; i++) {
    enterPoint(balls[i].p);
    cin >> balls[i].r;
  }
  sort(balls.begin(), balls.end(), comp);
  for (long long i = n - 1; i >= 0; i--) {
    for (long long j = i - 1; j >= 0; j--) {
      if (getDist(balls[i].p, balls[j].p) < balls[j].r) {
        tree[j].push_back(i);
        break;
      }
    }
  }
  for (long long i = 0; i < n; i++) {
    if (c[i] == 0) {
      dfs(i, 0);
    }
  }
  printf("%.9f", (a1 + a2) * acos(-1));
  return 0;
}
