#include <bits/stdc++.h>
using namespace std;
const int MOD = (int)1e9 + 7;
const int FFTMOD = 1007681537;
const int INF = (int)1e9;
const long long LINF = (long long)1e18;
const long double PI = acos((long double)-1);
const long double EPS = 1e-9;
inline long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
inline long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
inline long long fpow(long long n, long long k, int p = MOD) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
template <class T>
inline int chkmin(T& a, const T& val) {
  return val < a ? a = val, 1 : 0;
}
template <class T>
inline int chkmax(T& a, const T& val) {
  return a < val ? a = val, 1 : 0;
}
inline long long isqrt(long long k) {
  long long r = sqrt(k) + 1;
  while (r * r > k) r--;
  return r;
}
inline long long icbrt(long long k) {
  long long r = cbrt(k) + 1;
  while (r * r * r > k) r--;
  return r;
}
inline void addmod(int& a, int val, int p = MOD) {
  if ((a = (a + val)) >= p) a -= p;
}
inline void submod(int& a, int val, int p = MOD) {
  if ((a = (a - val)) < 0) a += p;
}
inline int mult(int a, int b, int p = MOD) { return (long long)a * b % p; }
inline int inv(int a, int p = MOD) { return fpow(a, p - 2, p); }
inline int sign(long double x) { return x < -EPS ? -1 : x > +EPS; }
inline int sign(long double x, long double y) { return sign(x - y); }
struct PT {
  long double x, y;
  PT() : x(0), y(0) {}
  PT(long double x, long double y) : x(x), y(y) {}
  PT(const PT& p) : x(p.x), y(p.y) {}
  int operator<(const PT& rhs) const {
    if (sign(y, rhs.y)) return sign(y, rhs.y) < 0;
    if (sign(x, rhs.x)) return sign(x, rhs.x) < 0;
    return make_pair(y, x) < make_pair(rhs.y, rhs.x);
  }
  int operator==(const PT& rhs) const {
    return make_pair(y, x) == make_pair(rhs.y, rhs.x);
  }
  PT operator+(const PT& p) const { return PT(x + p.x, y + p.y); }
  PT operator-(const PT& p) const { return PT(x - p.x, y - p.y); }
  PT operator*(long double c) const { return PT(x * c, y * c); }
  PT operator/(long double c) const { return PT(x / c, y / c); }
};
inline long double sqr(long double x) { return x * x; }
long double cross(PT p, PT q) { return p.x * q.y - p.y * q.x; }
long double area(PT a, PT b, PT c) {
  return fabs(cross(a, b) + cross(b, c) + cross(c, a)) / 2;
}
long double area2(PT a, PT b, PT c) {
  return cross(a, b) + cross(b, c) + cross(c, a);
}
long double dot(PT p, PT q) { return p.x * q.x + p.y * q.y; }
long double dist(PT p, PT q) { return sqrt(dot(p - q, p - q)); }
long double dist2(PT p, PT q) { return dot(p - q, p - q); }
PT RotateCCW90(PT p) { return PT(-p.y, p.x); }
PT RotateCW90(PT p) { return PT(p.y, -p.x); }
PT RotateCCW(PT p, long double t) {
  return PT(p.x * cos(t) - p.y * sin(t), p.x * sin(t) + p.y * cos(t));
}
vector<PT> CircleCircleIntersection(PT a, PT b, long double r, long double R) {
  vector<PT> res;
  long double d = sqrt(dist2(a, b));
  long double x = (d * d - R * R + r * r) / (2 * d);
  long double y = sqrt(max((long double)0.0, r * r - x * x));
  PT v = (b - a) / d;
  res.push_back(a + v * x + RotateCCW90(v) * y);
  if (y > 0) res.push_back(a + v * x - RotateCCW90(v) * y);
  return res;
}
const int maxn = 500 + 5;
int n;
int x[maxn];
int y[maxn];
int r[maxn];
int f[maxn];
vector<PT> pts[maxn];
int dj[maxn];
int find(int u) { return dj[u] == u ? dj[u] : dj[u] = find(dj[u]); }
void join(int u, int v) { dj[find(u)] = find(v); }
void chemthan() {
  cin >> n;
  for (int i = (0); i < (n); ++i) cin >> x[i] >> y[i] >> r[i];
  for (int i = (0); i < (n); ++i) dj[i] = i;
  vector<PT> tmp;
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j) {
      if (make_tuple(x[i], y[i], r[i]) == make_tuple(x[j], y[j], r[j])) {
        f[j] = 1;
      }
    }
  for (int i = (0); i < (n); ++i)
    for (int j = (i + 1); j < (n); ++j)
      if (!f[i] && !f[j]) {
        auto isqr = [&](int x) { return (long long)x * x; };
        long long d = isqr(x[i] - x[j]) + isqr(y[i] - y[j]);
        if (isqr(r[i] - r[j]) <= d && d <= isqr(r[i] + r[j])) {
          join(i, j);
          vector<PT> vps = CircleCircleIntersection(PT(x[i], y[i]),
                                                    PT(x[j], y[j]), r[i], r[j]);
          for (PT q : vps) {
            pts[i].push_back(q);
            pts[j].push_back(q);
            tmp.push_back(q);
          }
        }
      }
  int res = 1;
  sort((tmp).begin(), (tmp).end());
  for (int i = (0); i < (int((tmp).size())); ++i) {
    if (!i || sign(dist(tmp[i], tmp[i - 1]))) {
      res--;
    }
  }
  for (int i = (0); i < (n); ++i)
    if (!f[i]) {
      sort((pts[i]).begin(), (pts[i]).end());
      for (int j = (0); j < (int((pts[i]).size())); ++j) {
        if (!j || sign(dist(pts[i][j], pts[i][j - 1]))) {
          res++;
        }
      }
    }
  for (int i = (0); i < (n); ++i)
    if (!f[i] && dj[i] == i) {
      res++;
    }
  cout << res << "\n";
}
int main(int argc, char* argv[]) {
  ios_base::sync_with_stdio(0), cin.tie(0);
  if (argc > 1) {
    assert(freopen(argv[1], "r", stdin));
  }
  if (argc > 2) {
    assert(freopen(argv[2], "wb", stdout));
  }
  chemthan();
  return 0;
}
