#include <bits/stdc++.h>   using namespace std;   vector<pair<double, double>> v[4];   double x[3], y[3], r[3];   void add_point(int p, double x, double y) {     for (int t = 0; t < v[p].size(); t++)       if (fabs(x - v[p][t].first) < 1e-7 && fabs(y - v[p][t].second) < 1e-7)         return;     v[p].push_back(make_pair(x, y));   }   int main() {     int n, ans = 0;     cin >> n;     for (int i = 0; i < n; i++) cin >> x[i] >> y[i] >> r[i];     for (int i = 0; i < n; i++) {       for (int j = 0; j < n; j++) {         double a = 2 * (x[j] - x[i]), b = 2 * (y[j] - y[i]),                c = (a * a + b * b) / 4 + r[i] * r[i] - r[j] * r[j];         double d = a * a + b * b, x0 = a * c / d + x[i], y0 = b * c / d + y[i],                md = r[i] * r[i] * d - c * c;         if (i == j || md < 0) continue;         b *= sqrt(md) / d, a *= sqrt(md) / d;         for (int k = 0, p[3] = {3, i, j}; k < 3; k++)           add_point(p[k], x0 + b, y0 - a), add_point(p[k], x0 - b, y0 + a);       }       ans += v[i].size() ? v[i].size() : 1;     }     cout << ans + 2 - (v[3].size() ? v[3].size() : 1) << endl;     return 0;   }   