#include <bits/stdc++.h>
using namespace std;
long double EPS = 0.0000001;
vector<pair<long double, long double> > ms;
vector<pair<long double, long double> > g;
long double Xx, Yy;
long long V;
long long Ch(long double r, long double a, long double b, long double c,
             long double xa, long double ya) {
  long double x0 = -a * c / (a * a + b * b), y0 = -b * c / (a * a + b * b);
  if (c * c > r * r * (a * a + b * b) + EPS)
    return 0;
  else if (abs(c * c - r * r * (a * a + b * b)) < EPS) {
    Xx = x0;
    Yy = y0;
    return 1;
  } else {
    long double d = r * r - c * c / (a * a + b * b);
    long double mult = sqrt(d / (a * a + b * b));
    long double ax, ay, bx, by;
    ax = x0 + b * mult + xa;
    bx = x0 - b * mult + xa;
    ay = y0 - a * mult + ya;
    by = y0 + a * mult + ya;
    g.push_back(make_pair(ax, ay));
    g.push_back(make_pair(bx, by));
    return 2;
  }
}
bool check(long long xa, long long ya, long long ra, long long xb, long long yb,
           long long rb) {
  if (xa == xb && ya == yb) return false;
  xb -= xa;
  yb -= ya;
  long double A = -2 * xb;
  long double B = -2 * yb;
  long double C = xb * xb + yb * yb + ra * ra - rb * rb;
  long long res = Ch(ra, A, B, C, xa, ya);
  if (res == 1) {
    V++;
    Xx += (long double)xa;
    Yy += (long double)ya;
    ms.push_back(make_pair(Xx, Yy));
    g.push_back(make_pair(Xx, Yy));
  }
  if (res == 2) return true;
  return false;
}
bool X(long long xa, long long ya, long long ra, long long xb, long long yb,
       long long rb) {
  if (xa == xb && ya == yb && ra == rb) return true;
  return false;
}
void solt(long long xa, long long ya, long long ra, long long xb, long long yb,
          long long rb) {
  if (X(xa, ya, ra, xb, yb, rb)) {
    cout << 2 << endl;
    exit(0);
  }
  if (check(xa, ya, ra, xb, yb, rb))
    cout << 4 << endl;
  else
    cout << 3 << endl;
  exit(0);
}
bool rav(pair<long double, long double> a, pair<long double, long double> b) {
  if (abs(a.first - b.first) < EPS && abs(a.second - b.second) < EPS)
    return true;
  return false;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long n;
  cin >> n;
  if (n == 1) {
    long long x, y, r;
    cin >> x >> y >> r;
    cout << 2 << endl;
    return 0;
  }
  if (n == 2) {
    long long xa, ya, ra;
    long long xb, yb, rb;
    cin >> xa >> ya >> ra;
    cin >> xb >> yb >> rb;
    solt(xa, ya, ra, xb, yb, rb);
  }
  if (n == 3) {
    V = 0;
    long long xa, ya, ra;
    long long xb, yb, rb;
    long long xc, yc, rc;
    cin >> xa >> ya >> ra;
    cin >> xb >> yb >> rb;
    cin >> xc >> yc >> rc;
    long long Z = 0;
    if (X(xa, ya, ra, xb, yb, rb)) {
      solt(xa, ya, ra, xc, yc, rc);
    }
    if (X(xa, ya, ra, xc, yc, rc)) {
      solt(xa, ya, ra, xb, yb, rb);
    }
    if (X(xc, yc, rc, xb, yb, rb)) {
      solt(xa, ya, ra, xc, yc, rc);
    }
    Z += check(xa, ya, ra, xb, yb, rb);
    Z += check(xc, yc, rc, xb, yb, rb);
    Z += check(xa, ya, ra, xc, yc, rc);
    long long M = 0;
    sort(g.begin(), g.end());
    sort(ms.begin(), ms.end());
    long long huj = 1;
    for (long long i = 1; i < g.size(); i++) {
      if (rav(g[i], g[i - 1]))
        huj++;
      else {
        if (huj == 3) M++;
        huj = 1;
      }
    }
    if (huj == 3) M++;
    if (V == 2 && Z == 1) {
      cout << 6 << endl;
      return 0;
    }
    if (V == 1 && Z == 2) {
      cout << 7 - M << endl;
      return 0;
    }
    if (V == 3 && !rav(ms[0], ms.back())) {
      cout << 5 << endl;
      return 0;
    }
    if (Z == 3)
      cout << 8 - M << endl;
    else
      cout << 4 + Z << endl;
  }
}
