#include <bits/stdc++.h>
using namespace std;
inline int read() {
  int x = 0;
  char ch = getchar();
  while (!isdigit(ch)) ch = getchar();
  while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
  return x;
}
inline int Less(double a, double b) { return a + 1e-9 < b; }
inline int Equal(double a, double b) { return fabs(a - b) < 1e-9; }
struct circle {
  double x, y, r;
  inline void init() { scanf("%lf%lf%lf", &x, &y, &r); }
} c[5];
struct point {
  double x, y;
  inline point(double tmp1 = 0, double tmp2 = 0) { x = tmp1, y = tmp2; }
};
inline double sqr(double x) { return x * x; }
inline double dis(double x, double y, double a, double b) {
  return sqrt(sqr(x - a) + sqr(y - b));
}
inline vector<point> ip(circle X, circle Y) {
  double x = X.x, y = X.y, R = X.r;
  double a = Y.x, b = Y.y, S = Y.r;
  double d = dis(x, y, a, b);
  if (d > R + S || d < fabs(R - S)) {
    vector<point> ans(0);
    return ans;
  }
  double A = (sqr(R) - sqr(S) + sqr(d)) / (2 * d);
  double h = sqrt(sqr(R) - sqr(A));
  double x2 = x + A * (a - x) / d, y2 = y + A * (b - y) / d;
  double x3 = x2 - h * (b - y) / d, y3 = y2 + h * (a - x) / d;
  double x4 = x2 + h * (b - y) / d, y4 = y2 - h * (a - x) / d;
  vector<point> ans;
  ans.push_back(point(x3, y3));
  ans.push_back(point(x4, y4));
  return ans;
}
inline int unique(vector<point> p) {
  int cnt = 0;
  sort(p.begin(), p.end(), [&](point a, point b) {
    return Less(a.x, b.x) || Equal(a.x, b.x) && Less(a.y, b.y);
  });
  for (int i = 0; i < p.size(); i++)
    if (!i || (!Equal(p[i].x, p[i - 1].x) || !Equal(p[i].y, p[i - 1].y))) ++cnt;
  return cnt;
}
inline int solve(circle a, circle b) {
  vector<point> ans = ip(a, b);
  int w = unique(ans);
  return w == 2 ? 4 : 3;
}
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) c[i].init();
  if (n == 1) return puts("2");
  if (n == 2) return printf("%d\n", solve(c[1], c[2])), 0;
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      vector<point> ans = ip(c[i], c[j]);
      int w = unique(ans);
      if (!w) continue;
      for (int k = 1; k <= n; k++)
        if (k != i && k != j) {
          vector<point> a = ip(c[i], c[k]);
          vector<point> b = ip(c[j], c[k]), ans;
          for (int i = 0; i < a.size(); i++) ans.push_back(a[i]);
          for (int i = 0; i < b.size(); i++) ans.push_back(b[i]);
          int w = unique(ans);
          printf("%d\n", solve(c[i], c[j]) + max(1, w));
          exit(0);
        }
    }
  puts("4");
  return 0;
}
