#include <bits/stdc++.h>
using namespace std;
int n;
struct circ {
  int x, y, r;
} p[3];
inline int sq(int a) { return a * a; }
int dsq(circ &c1, circ &c2) { return sq(c1.x - c2.x) + sq(c1.y - c2.y); }
int two(int i, int j) {
  int c = dsq(p[i], p[j]) - sq(p[i].r + p[j].r);
  int d = dsq(p[i], p[j]) - sq(p[i].r - p[j].r);
  if (c > 0 || d < 0)
    return -1;
  else if (c == 0 || d == 0)
    return 0;
  else
    return 1;
}
int three() {
  int x0 = p[0].x;
  int y0 = p[0].y;
  int r0 = p[0].r;
  int x1 = p[1].x;
  int y1 = p[1].y;
  int r1 = p[1].r;
  int x2 = p[2].x;
  int y2 = p[2].y;
  int r2 = p[2].r;
  int a1 = 2 * (x1 - x0);
  int b1 = 2 * (y1 - y0);
  int c1 = sq(r0) - sq(r1) - sq(x0) + sq(x1) - sq(y0) + sq(y1);
  int a2 = 2 * (x2 - x0);
  int b2 = 2 * (y2 - y0);
  int c2 = sq(r0) - sq(r2) - sq(x0) + sq(x2) - sq(y0) + sq(y2);
  int det = a1 * b2 - a2 * b1;
  if (det == 0) {
    if (b2 * c1 - b1 * c2 == 0 && a1 * c2 - a2 * c1 == 0)
      return 2;
    else
      return 0;
  }
  int xmd = b2 * c1 - b1 * c2;
  int ymd = a1 * c2 - a2 * c1;
  if (sq(xmd - det * x0) + sq(ymd - det * y0) == sq(det) * sq(r0)) return 1;
  return 0;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d %d %d", &p[i].x, &p[i].y, &p[i].r);
  }
  if (n == 1) {
    puts("2");
    return 0;
  }
  if (n == 2) {
    if (two(0, 1) == 1) {
      puts("4");
    } else {
      puts("3");
    }
    return 0;
  };
  bool f = false;
  srand((uintptr_t)main);
  for (int i = 0; i < 1000; i++) {
    random_shuffle(p, p + 3, [](int i) { return rand() % i; });
    if (two(0, 1) == 1) {
      f = true;
      break;
    }
  }
  if (f) {
    if (two(2, 0) == 1 && two(2, 1) == 1) {
      if (three() == 2) {
        puts("6");
      } else if (three() == 1) {
        puts("7");
      } else {
        puts("8");
      }
    } else if (two(2, 0) == 0 && two(2, 1) == 0) {
      puts("6");
    } else if (two(2, 0) == -1) {
      if (two(2, 1) == 1) {
        puts("6");
      } else {
        puts("5");
      }
    } else if (two(2, 1) == -1) {
      if (two(2, 0) == 1) {
        puts("6");
      } else {
        puts("5");
      }
    } else if (two(2, 0) + two(2, 1) == 1) {
      if (three()) {
        puts("6");
      } else {
        puts("7");
      }
    }
  } else {
    for (int i = 0; i < 1000; i++) {
      random_shuffle(p, p + 3, [](int i) { return rand() % i; });
      if (two(0, 1) == 0) {
        f = true;
        break;
      }
    }
    if (f) {
      if (two(2, 0) == 0 && two(2, 1) == 0) {
        if (three() == 2)
          puts("4");
        else
          puts("5");
      } else {
        puts("4");
      }
    } else {
      puts("4");
      return 0;
    }
  }
  return 0;
}
