#include <bits/stdc++.h>
using namespace std;
template <typename T1, typename T2>
inline void chkmin(T1 &first, T2 second) {
  if (first > second) first = second;
}
template <typename T1, typename T2>
inline void chkmax(T1 &first, T2 second) {
  if (first < second) first = second;
}
const string FILENAME = "input";
const long double eps = 1e-7;
const int MAXN = 1e5;
long double r[3];
pair<long double, long double> a[3];
long double vec(pair<long double, long double> a,
                pair<long double, long double> b) {
  return a.first * b.second - a.second * b.first;
}
bool half(pair<long double, long double> a) {
  if (a.first != 0) return a.first < 0;
  return a.second < 0;
}
pair<long double, long double> operator+(pair<long double, long double> a,
                                         pair<long double, long double> b) {
  return {a.first + b.first, a.second + b.second};
}
pair<long double, long double> operator-(pair<long double, long double> a,
                                         pair<long double, long double> b) {
  return {a.first - b.first, a.second - b.second};
}
long double dist(pair<long double, long double> a,
                 pair<long double, long double> b) {
  return hypot(a.first - b.first, a.second - b.second);
}
pair<long double, long double> c;
bool cmp(pair<long double, long double> a, pair<long double, long double> b) {
  if (half(a - c) != half(b - c)) {
    return half(a - c) < half(b - c);
  }
  return vec(a - c, b - c) < 0;
}
int n;
vector<int> edge[MAXN];
vector<pair<long double, long double> > all;
vector<pair<long double, long double> > que[3];
vector<int> nq[3];
bool used[MAXN];
void dfs(int i) {
  if (used[i]) return;
  used[i] = true;
  for (auto j : edge[i]) {
    dfs(j);
  }
}
int main() {
  ios::sync_with_stdio(0);
  srand(time(0));
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> a[i].first >> a[i].second >> r[i];
    for (int j = 0; j < 200; ++j) {
      int alp = j;
      pair<long double, long double> v = {sin(alp), cos(alp)};
      v.first *= r[i];
      v.second *= r[i];
      que[i].push_back(a[i] + v);
    }
    for (int j = 0; j < i; ++j) {
      pair<long double, long double> v = a[i] - a[j];
      long double d = dist(a[i], a[j]);
      if (d < eps) continue;
      double L = (d + (r[i] * r[i] - r[j] * r[j]) / d) / 2;
      double dh = sqrt(abs(r[i] * r[i] - L * L));
      v.first /= d;
      v.second /= d;
      pair<long double, long double> M =
          a[i] - make_pair(v.first * L, v.second * L);
      swap(v.first, v.second);
      v.first = -v.first;
      pair<long double, long double> F1 =
          M + make_pair(v.first * dh, v.second * dh);
      pair<long double, long double> F2 =
          M - make_pair(v.first * dh, v.second * dh);
      if (abs(dist(F1, a[i]) - r[i]) < eps &&
          abs(dist(F1, a[j]) - r[j]) < eps) {
        que[j].push_back(F2);
        que[i].push_back(F2);
        que[i].push_back(F1);
        que[j].push_back(F1);
      }
    }
  }
  int V = 0;
  int E = 0;
  int F = 0;
  int C = 0;
  for (int i = 0; i < n; ++i) {
    c = a[i];
    sort(que[i].begin(), que[i].end(), cmp);
    for (auto j : que[i]) {
      all.push_back(j);
      ++V;
    }
    set<int> used;
    for (auto j : que[i]) {
      for (int q = 0;; ++q) {
        assert(q < all.size());
        if (dist(all[q], j) < eps) {
          if (used.count(q)) break;
          used.insert(q);
          nq[i].push_back(q);
          break;
        }
      }
    }
    nq[i].push_back(nq[i][0]);
    for (int j = 0; j + 1 < nq[i].size(); ++j) {
      E += 1;
      edge[nq[i][j]].push_back(nq[i][j + 1]);
      edge[nq[i][j + 1]].push_back(nq[i][j]);
    }
  }
  for (int i = 0; i < V; ++i) {
    if (!used[i]) {
      ++C;
      dfs(i);
    }
  }
  cout << 1 + C + E - V << endl;
}
