#include <bits/stdc++.h>
using namespace std;
template <class T>
T Bitcnt(T a) {
  int sum = 0;
  while (a) {
    if (a & 1) sum++;
    a /= 2;
  }
  return sum;
}
template <class T>
T Max3(T a, T b, T c) {
  return max(a, max(b, c));
}
template <class T>
T Lcm(T a, T b) {
  T tmp = __gcd(a, b);
  return (a / tmp) * b;
}
template <class T>
T Pow(T a, T b) {
  T ans = 1;
  T base = a;
  while (b) {
    if (b & 1) ans = (ans * base);
    base = (base * base);
    b /= 2;
  }
  return ans;
}
long long Bigmod(long long a, long long b) {
  long long res = 1;
  long long pw = a % 1000000007LL;
  while (b > 0) {
    if (b & 1) res = (res * pw) % 1000000007LL;
    pw = (pw * pw) % 1000000007LL;
    b /= 2;
  }
  return res;
}
int a_x[] = {1, -1, 0, 0};
int a_y[] = {0, 0, 1, -1};
long long X, Y;
void extend_euclid(long long a, long long b) {
  if (b == 0) {
    X = 1;
    Y = 0;
    return;
  }
  extend_euclid(b, a % b);
  long long x, y;
  x = Y;
  y = X - (a / b) * Y;
  X = x;
  Y = y;
}
long long inverse_modulo(long long a, long long b) {
  extend_euclid(a, b);
  return (X + 1000000007LL) % 1000000007LL;
}
int mn[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
struct info {
  int x, y, r;
} data[1005];
vector<int> g[1005];
vector<int> graph[1005];
int n;
bool inside[1005][1005];
bool visit[1005];
vector<int> st;
int par[1005];
long long int dist(long long int x1, long long int y1, long long int x2,
                   long long int y2) {
  return (x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2);
}
bool Inside(long long int id1, long long int id2) {
  long long int d = dist(data[id1].x, data[id1].y, data[id2].x, data[id2].y);
  double f = sqrt((double)d);
  f += ((double)data[id2].r);
  if (data[id1].r + 1e-9 >= f)
    return true;
  else
    return false;
}
void dfs(int node) {
  visit[node] = 1;
  int len = graph[node].size();
  for (int i = 0; i < len; i++) {
    int v = graph[node][i];
    if (visit[v] == 0) {
      dfs(v);
    }
  }
  st.push_back(node);
}
void pre() {
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      inside[i][j] = Inside(i, j);
      if (inside[i][j]) graph[i].push_back(j);
    }
  for (int i = 1; i <= n; i++) {
    if (visit[i] == 0) dfs(i);
  }
  for (int i = 0; i < n; i++) {
    int u = st[i];
    for (int v = 1; v <= n; v++) {
      if (inside[u][v]) {
        if (par[v] == 0) {
          par[v] = u;
          g[u].push_back(v);
        }
      }
    }
  }
}
long long dp[1005][5];
bool ok[1005][5];
long long solve(int node, int taken) {
  long long &ret = dp[node][taken];
  if (ok[node][taken]) return ret;
  ok[node][taken] = 1;
  ret = 0;
  int len = g[node].size();
  if (taken == 0) {
    ret = data[node].r * 1LL * data[node].r;
    for (int i = 0; i < len; i++) {
      int v = g[node][i];
      if (par[node] == v) continue;
      ret += solve(v, taken + 1);
    }
  }
  if (taken == 1) {
    long long ret1 = data[node].r * 1LL * data[node].r;
    ret1 *= (-1);
    for (int i = 0; i < len; i++) {
      int v = g[node][i];
      if (par[node] == v) continue;
      ret1 += solve(v, taken - 1);
    }
    long long ret2 = data[node].r * 1LL * data[node].r;
    for (int i = 0; i < len; i++) {
      int v = g[node][i];
      if (par[node] == v) continue;
      ret2 += solve(v, taken + 1);
    }
    ret = max(ret1, ret2);
  }
  if (taken == 2) {
    ret = data[node].r * 1LL * data[node].r;
    ret *= (-1);
    for (int i = 0; i < len; i++) {
      int v = g[node][i];
      if (par[node] == v) continue;
      ret += solve(v, taken - 1);
    }
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++)
    scanf("%d %d %d", &data[i].x, &data[i].y, &data[i].r);
  pre();
  memset(dp, -1, sizeof dp);
  long long res = 0;
  for (int i = 1; i <= n; i++) {
    if (par[i] == 0) res += solve(i, 0);
  }
  printf("%.12lf\n", res * 1.0 * acos(-1.0));
  return 0;
}
