#include <bits/stdc++.h>
using namespace std;
void si(int &n) { scanf("%d", &n); }
void sii(int &n, int &m) { scanf("%d%d", &n, &m); }
constexpr long long int TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
template <class T>
bool uin(T &a, T b) {
  return a > b ? (a = b, true) : false;
}
template <class T>
bool uax(T &a, T b) {
  return a < b ? (a = b, true) : false;
}
const int N = 1505;
const int M = 1e6 + 6;
const long long int MOD = 1e9 + 7;
int main() {
  int n, r[N], in[N];
  pair<int, int> p[N];
  fill(&in[0], &in[0] + N, 0);
  cin >> n;
  for (int i = 0; i < (int)(n); ++i) {
    sii(p[i].first, p[i].second);
    si(r[i]);
  }
  for (int i = 0; i < (int)(n); ++i)
    for (int j = 0; j < (int)(n); ++j) {
      if (i != j && r[i] < r[j]) {
        if (abs((p[i].first - p[j].first)) * 1ll *
                    abs((p[i].first - p[j].first)) +
                abs((p[i].second - p[j].second)) * 1ll *
                    abs((p[i].second - p[j].second)) <=
            1ll * abs(r[i] - r[j]) * abs(r[i] - r[j]))
          in[i]++;
      }
    }
  long double ans = 0, d, pi = 3.14159265358979323846264338327950288419;
  for (int i = 0; i < (int)(n); ++i) {
    if (in[i] == 0 || in[i] & 1) {
      d = r[i];
      ans += d * d * pi;
    } else {
      d = r[i];
      ans -= d * d * pi;
    }
  }
  cout << setprecision(17) << ans;
}
