#include <bits/stdc++.h>
using namespace std;
long long overflow = LLONG_MAX;
const double pi = 3.141592653589793238462643383279502884197169399375105;
double distance(long long a1, long long a2, long long b1, long long b2) {
  return (a1 - a2) * (a1 - a2) + (b1 - b2) * (b1 - b2);
}
vector<vector<double>> intersect(long long a1, long long a2, long long b1,
                                 long long b2, long long r1, long long r2) {
  double length = distance(a1, a2, b1, b2);
  vector<vector<double>> inters;
  if ((r1 + r2) * (r1 + r2) == distance(a1, a2, b1, b2)) {
    double x1 = (double)(r1 * a2 + r2 * a1) / (double)(r1 + r2);
    double y1 = (double)(r1 * b2 + r2 * b1) / (double)(r1 + r2);
    inters.push_back({x1, y1});
    return inters;
  } else if ((r1 - r2) * (r1 - r2) == distance(a1, a2, b1, b2)) {
    double x1 = (double)(r1 * a2 - r2 * a1) / (double)(r1 - r2);
    double y1 = (double)(r1 * b2 - r2 * b1) / (double)(r1 - r2);
    inters.push_back({x1, y1});
    return inters;
  }
  long long p, q, k;
  p = 2 * a2 - 2 * a1;
  q = 2 * b2 - 2 * b1;
  k = r1 * r1 - r2 * r2 - a1 * a1 + a2 * a2 - b1 * b1 + b2 * b2;
  if (q == 0) {
    double m = (double)k / (double)p;
    double d = r1 * r1 - (m - a1) * (m - a1);
    if (d < 0)
      return inters;
    else {
      double x1 = m;
      double x2 = m;
      double y1 = b1 + sqrt(r1 * r1 - (m - a1) * (m - a1));
      double y2 = b1 - sqrt(r1 * r1 - (m - a1) * (m - a1));
      inters.push_back({x1, y1});
      inters.push_back({x2, y2});
      return inters;
    }
  } else {
    double m, n;
    m = -(double)p / (double)q;
    n = (double)k / (double)q;
    double d, e, f;
    d = m * m + 1;
    e = m * n - a1 - m * b1;
    f = a1 * a1 + n * n + b1 * b1 - 2 * n * b1 - r1 * r1;
    if (e * e - d * f < 0) {
      return inters;
    } else {
      double x1 = (-e + sqrt(e * e - d * f)) / d;
      double x2 = (-e - sqrt(e * e - d * f)) / d;
      double y1 = m * x1 + n;
      double y2 = m * x2 + n;
      inters.push_back({x1, y1});
      inters.push_back({x2, y2});
      return inters;
    }
  }
}
void really(vector<vector<double>> &p1, vector<vector<double>> &p2,
            vector<vector<double>> &result) {
  for (int i = 0; i < p1.size(); i++) {
    result.push_back(p1[i]);
  }
  for (int i = 0; i < p2.size(); i++) {
    result.push_back(p2[i]);
  }
  for (int i = 0; i < result.size(); i++) {
    for (int j = i + 1; j < result.size(); j++) {
      if (abs(result[i][0] - result[j][0]) < 1e-3 &&
          abs(result[i][1] - result[j][1]) < 1e-3) {
        auto it = result.begin() + j;
        result.erase(it);
        j--;
      }
    }
  }
}
void print(vector<vector<double>> c1) {
  for (int i = 0; i < c1.size(); i++) {
    for (int j = 0; j < c1[i].size(); j++) {
      cout << c1[i][j] << " ";
    }
    cout << endl;
  }
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  if (n == 1) {
    int a, b, r;
    cin >> a >> b >> r;
    cout << 2;
  } else if (n == 2) {
    long long circle[2][3];
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 3; j++) {
        cin >> circle[i][j];
      }
    }
    long long length =
        distance(circle[0][0], circle[1][0], circle[0][1], circle[1][1]);
    if ((circle[0][2] + circle[1][2]) * (circle[0][2] + circle[1][2]) > length)
      cout << 4;
    else
      cout << 3;
  } else {
    long long circle[3][3];
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 3; j++) {
        cin >> circle[i][j];
      }
    }
    vector<vector<double>> c12 =
        intersect(circle[0][0], circle[1][0], circle[0][1], circle[1][1],
                  circle[0][2], circle[1][2]);
    vector<vector<double>> c13 =
        intersect(circle[0][0], circle[2][0], circle[0][1], circle[2][1],
                  circle[0][2], circle[2][2]);
    vector<vector<double>> c23 =
        intersect(circle[2][0], circle[1][0], circle[2][1], circle[1][1],
                  circle[2][2], circle[1][2]);
    if (c12.size() == 0 && c13.size() == 0 && c23.size() == 0) {
      cout << 4;
    } else if (c12.size() == 0 && c13.size() == 0) {
      if (c23.size() == 2) {
        cout << 5;
      } else {
        cout << 4;
      }
    } else if (c13.size() == 0 && c23.size() == 0) {
      if (c12.size() == 2) {
        cout << 5;
      } else {
        cout << 4;
      }
    } else if (c12.size() == 0 && c23.size() == 0) {
      if (c13.size() == 2) {
        cout << 5;
      } else {
        cout << 4;
      }
    } else {
      vector<vector<double>> c1;
      vector<vector<double>> c2;
      vector<vector<double>> c3;
      vector<vector<double>> vertex;
      really(c12, c13, c1);
      really(c23, c12, c2);
      really(c13, c23, c3);
      really(c12, c13, vertex);
      really(c23, c12, vertex);
      really(c13, c23, vertex);
      long long v, d;
      d = c1.size() + c2.size() + c3.size();
      v = vertex.size();
      cout << 2 + d - v;
    }
  }
  return 0;
}
