#include <bits/stdc++.h>
using namespace std;
int n, dian, bian, san;
int x[5], y[5], r[5];
struct point {
  double x, y;
};
struct line {
  int a, b, c;
};
int squ(int x) { return x * x; }
double squ(double x) { return x * x; }
double dist(int a, int b, line c) {
  return abs(c.a * a + c.b * b + c.c) / (double)sqrt(squ(c.a) + squ(c.b));
}
int gcd(int x, int y) {
  if (!y) return x;
  return gcd(y, x % y);
}
line g2l(int a, int b) {
  line tmp;
  tmp.a = -2 * (x[a] - x[b]);
  tmp.b = -2 * (y[a] - y[b]);
  tmp.c = squ(x[a]) - squ(x[b]) + squ(y[a]) - squ(y[b]) - squ(r[a]) + squ(r[b]);
  int tmp2 = max(abs(tmp.a), max(abs(tmp.b), abs(tmp.c)));
  if (tmp.a != 0) tmp2 = gcd(tmp2, abs(tmp.a));
  if (tmp.b != 0) tmp2 = gcd(tmp2, abs(tmp.b));
  if (tmp.c != 0) tmp2 = gcd(tmp2, abs(tmp.c));
  tmp.a /= tmp2;
  tmp.b /= tmp2;
  tmp.c /= tmp2;
  return tmp;
}
bool pdl(line a, line b) {
  if (a.a - b.a == 0 && a.b - b.b == 0 && a.c - b.c == 0) return true;
  if (a.a + b.a == 0 && a.b + b.b == 0 && a.c + b.c == 0) return true;
  return false;
}
int hls(int a, int b, int c, int d) { return a * d - b * c; }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) cin >> x[i] >> y[i] >> r[i];
  if (n == 1) {
    printf("2\n");
    return 0;
  }
  if (n == 2) {
    if (squ(x[1] - x[2]) + squ(y[1] - y[2]) > squ(r[1] + r[2]))
      return cout << 3 << endl, 0;
    if (squ(x[1] - x[2]) + squ(y[1] - y[2]) == squ(r[1] + r[2]))
      return cout << 3 << endl, 0;
    if (squ(x[1] - x[2]) + squ(y[1] - y[2]) < squ(r[1] + r[2]) &&
        squ(x[1] - x[2]) + squ(y[1] - y[2]) > squ(r[1] - r[2]))
      return cout << 4 << endl, 0;
    if (squ(x[1] - x[2]) + squ(y[1] - y[2]) == squ(r[1] - r[2]))
      return cout << 3 << endl, 0;
    if (squ(x[1] - x[2]) + squ(y[1] - y[2]) < squ(r[1] - r[2]))
      return cout << 3 << endl, 0;
    return 0;
  }
  for (int i = 1; i <= n; i++) {
    int flag = 0;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) > squ(r[i] + r[j])) flag++;
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) < squ(r[i] - r[j])) flag++;
      }
    if (flag == 2) {
      swap(x[i], x[3]), swap(y[i], y[3]), swap(r[i], r[3]);
      if (squ(x[1] - x[2]) + squ(y[1] - y[2]) > squ(r[1] + r[2]))
        return cout << 4 << endl, 0;
      if (squ(x[1] - x[2]) + squ(y[1] - y[2]) == squ(r[1] + r[2]))
        return cout << 4 << endl, 0;
      if (squ(x[1] - x[2]) + squ(y[1] - y[2]) < squ(r[1] + r[2]) &&
          squ(x[1] - x[2]) + squ(y[1] - y[2]) > squ(r[1] - r[2]))
        return cout << 5 << endl, 0;
      if (squ(x[1] - x[2]) + squ(y[1] - y[2]) == squ(r[1] - r[2]))
        return cout << 4 << endl, 0;
      if (squ(x[1] - x[2]) + squ(y[1] - y[2]) < squ(r[1] - r[2]))
        return cout << 4 << endl, 0;
      return 0;
    }
  }
  int flag_V = 0;
  line V[5];
  V[3] = g2l(1, 2);
  V[2] = g2l(1, 3);
  V[1] = g2l(2, 3);
  for (int i = 1; i <= 3; i++)
    for (int j = i + 1; j <= 3; j++)
      if (!pdl(V[i], V[j])) flag_V = 1;
  if (flag_V == 0) {
    for (int i = 1; i <= 3; i++)
      if (fabs(dist(x[i], y[i], V[i]) - r[i]) > 1e-7) flag_V = 1;
    if (flag_V == 1) return cout << 6 << endl, 0;
    return cout << 4 << endl, 0;
  }
  line q, w;
  q = V[1], w = V[2];
  int A1, A2, A3;
  A1 = hls(q.a, q.b, w.a, w.b);
  A2 = hls(-q.c, q.b, -w.c, w.b);
  A3 = hls(q.a, -q.c, w.a, -w.c);
  if (A1 != 0) {
    double X1 = A2 / (double)A1, Y1 = A3 / (double)A1;
    int flag = 0;
    for (int i = 1; i <= n; i++)
      if (fabs(squ(X1 - x[i]) + squ(Y1 - y[i]) - squ(r[i])) > 1e-7) flag = 1;
    if (!flag) san = 1;
  }
  q = V[3], w = V[2];
  A1, A2, A3;
  A1 = hls(q.a, q.b, w.a, w.b);
  A2 = hls(-q.c, q.b, -w.c, w.b);
  A3 = hls(q.a, -q.c, w.a, -w.c);
  if (A1 != 0) {
    double X1 = A2 / (double)A1, Y1 = A3 / (double)A1;
    int flag = 0;
    for (int i = 1; i <= n; i++)
      if (fabs(squ(X1 - x[i]) + squ(Y1 - y[i]) - squ(r[i])) > 1e-7) flag = 1;
    if (!flag) san = 1;
  }
  q = V[1], w = V[3];
  A1, A2, A3;
  A1 = hls(q.a, q.b, w.a, w.b);
  A2 = hls(-q.c, q.b, -w.c, w.b);
  A3 = hls(q.a, -q.c, w.a, -w.c);
  if (A1 != 0) {
    double X1 = A2 / (double)A1, Y1 = A3 / (double)A1;
    int flag = 0;
    for (int i = 1; i <= n; i++)
      if (fabs(squ(X1 - x[i]) + squ(Y1 - y[i]) - squ(r[i])) > 1e-7) flag = 1;
    if (!flag) san = 1;
  }
  for (int i = 1; i <= n; i++) {
    int tmp = 0;
    for (int j = 1; j <= n; j++)
      if (i != j) {
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) > squ(r[i] + r[j])) tmp += 0;
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) == squ(r[i] + r[j])) tmp += 1;
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) < squ(r[i] + r[j]) &&
            squ(x[i] - x[j]) + squ(y[i] - y[j]) > squ(r[i] - r[j]))
          tmp += 2;
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) == squ(r[i] - r[j])) tmp += 1;
        if (squ(x[i] - x[j]) + squ(y[i] - y[j]) < squ(r[i] - r[j])) tmp += 0;
      }
    dian += tmp;
    tmp -= san;
    bian += tmp;
  }
  dian -= san * 4;
  dian /= 2;
  cout << bian - dian + 2 << endl;
  return 0;
}
