#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <cstdio>
using namespace std;
struct pt
{
double x, y;
pt()
{
x = y = 0;
}
pt(double x_, double y_)
{
x = x_;
y = y_;
}
};
struct cir
{
pt z;
double r;
cir()
{
z = pt();
r = 0;
}
cir(pt z_, double r_)
{
z = z_;
r = r_;
}
};
vector <cir> ar;
int n;
double eps = 1e-8;
struct pare
{
double y;
int t;
pare()
{
}
pare(double y_, int t_)
{
y = y_;
t = t_;
}
bool operator < (const pare& obj) const
{
if (abs(y - obj.y) < eps)
{
return (t == -1 && obj.t == 1);
}
else
{
return y < obj.y;
}
}
};
vector <pare> line;
double f(double x_)
{
line.clear();
for (int i = 0; i < n; ++i)
{
double x = ar[i].z.x, y = ar[i].z.y, r = ar[i].r;
if (fabs(x - x_) < r - eps)
{
double y1 = y + sqrt(r * r - (x - x_) * (x - x_));
double y2 = y - sqrt(r * r - (x - x_) * (x - x_));
line.push_back(pare(y2, 1));
line.push_back(pare(y1, -1));
}
}
sort(line.begin(), line.end());
int lev = 0;
double lasty = 0;
double ans = 0;
for (int i = 0; i < line.size(); ++i)
{
if (lev == 0)
{
if (line[i].t == 1)
{
lasty = line[i].y;
}
}
lev += line[i].t;
if (lev == 0)
{
if (line[i].t == -1)
{
ans += line[i].y - lasty;
}
}
}
return ans;
}
double integral(double a, double b)
{
return (f(a) + f(b) + 4 * f((a + b) / 2)) * (b - a) / 6.0;
}
double simps(double a, double b)
{
double mid = (a + b) / 2;
double s1 = integral(a, b);
double sl = integral(a, mid);
double sr = integral(mid, b);
if (fabs(s1 - sl - sr) > eps)
return simps(a, mid) + simps(mid, b);
else
return s1;
}
int main()
{
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
cin >> n;
line.reserve(2 * n);
ar.resize(n);
double a = 10005, b = -10005;
for (int i = 0; i < n; ++i)
{
cin >> ar[i].z.x >> ar[i].z.y >> ar[i].r;
a = min(a, ar[i].z.x - ar[i].r);
b = max(b, ar[i].z.x + ar[i].r);
}
printf("%.5lf", simps(a, b));
return 0;
}