#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
int n, k, nrr = 1;
string s;
struct point {
  double x, y;
  point() {}
  point(const point& a) { x = a.x, y = a.y; }
  point(double _x, double _y) {
    x = _x;
    y = _y;
  }
  point& operator-(point& a) {
    point* r = new point(*this);
    r->x -= a.x, r->y -= a.y;
    return *r;
  }
  point& operator+(point& a) {
    point* r = new point(*this);
    r->x += a.x, r->y += a.y;
    return *r;
  }
  point& operator*(double val) {
    point* r = new point(*this);
    r->x *= val, r->y *= val;
    return *r;
  }
  point& operator/(double val) {
    point* r = new point(*this);
    r->x /= val, r->y /= val;
    return *r;
  }
  bool operator<(const point& a) const {
    if (fabs(x - a.x) < 1e-9) {
      if (fabs(y - a.y) < 1e-9) return false;
      return y < a.y;
    }
    return x < a.x;
  }
  bool operator==(const point& a) const {
    if (fabs(x - a.x) < 1e-9)
      if (fabs(y - a.y) < 1e-9) return true;
    return false;
  }
};
template <class T>
ostream& operator<<(ostream& out, vector<T> v) {
  out << v.size() << '\n';
  for (auto e : v) out << e << ' ';
  return out;
}
ostream& operator<<(ostream& out, point p) { return out << p.x << ' ' << p.y; }
struct line {
  double m, n;
  line(point A, point B) {
    m = (A.y - B.y) / (A.x - B.x);
    n = A.y - m * A.x;
  }
  line(point A, double _m) {
    m = _m;
    n = A.y - m * A.x;
  }
  line(double _m, double _n) {
    m = _m;
    n = _n;
  }
  point intersect(line l) {
    point O;
    O.x = (l.n - n) / (m - l.m);
    O.y = m * O.x + n;
    return O;
  }
};
double dx[] = {1, -1, -1, 1};
double dy[] = {1, -1, 1, -1};
long double dist(point a, point b) {
  long double X = a.x - b.x;
  long double Y = a.y - b.y;
  return sqrt(X * X + Y * Y);
}
struct circle {
  point o;
  double r;
  circle() {}
  circle(point a, point b, point c) {
    point mab = (a + b) / 2;
    point mbc = (c + b) / 2;
    line ab(a, b), bc(b, c);
    line ab1(mab, -1.0 / ab.m);
    line bc1(mbc, -1.0 / bc.m);
    o = ab1.intersect(bc1);
    r = dist(o, a);
  }
  bool operator==(circle& c) {
    if (fabs(c.r - r) > 1e-9) return false;
    if (fabs(c.o.x - o.x) > 1e-9) return false;
    if (fabs(c.o.y - o.y) > 1e-9) return false;
    return true;
  }
  vector<point> intersect(circle c) {
    long double p, h, a, area, d;
    d = dist(o, c.o);
    if (d > r + c.r) return {};
    if (d < fabs(r - c.r)) return {};
    a = 0.5 * (d + (r * r - c.r * c.r) / d);
    h = sqrt(r * r - a * a);
    point B = o + (c.o - o) * a / d;
    point aa = c.o - o;
    point ff(-aa.y, aa.x);
    aa = ff * h / d;
    return {B + aa, B - aa};
  }
};
struct seg {
  point a, b;
};
istream& operator>>(istream& in, point& p) { return in >> p.x >> p.y; }
istream& operator>>(istream& in, circle& c) { return in >> c.o >> c.r; }
istream& operator>>(istream& in, seg& s) { return in >> s.a >> s.b; }
long double area(point a, point b, point c) {
  return a.x * b.y + b.x * c.y + c.x * a.y - a.y * b.x - b.y * c.x - c.y * a.x;
  return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}
circle c[550];
map<point, int> mm;
set<double> coords;
vector<int> v[502 * 1000];
bool use[502 * 1000];
int C, V, E;
int get_real_p(point p) {
  if (mm.find(p) == mm.end()) mm[p] = nrr++;
  return mm[p];
}
void dfs(int k) {
  use[k] = 1;
  for (auto i : v[k])
    if (!use[i]) dfs(i);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> c[i];
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (c[i] == c[j]) swap(c[j], c[n]), n--, j--;
    }
  for (int i = 1; i <= n; i++) {
    set<int> inters;
    for (int j = 1; j <= n; j++) {
      if (i == j) continue;
      auto in = c[i].intersect(c[j]);
      for (auto p : in) {
        int ind = get_real_p(p);
        inters.insert(ind);
      }
    }
    for (auto i : inters) {
      if (i != *inters.begin())
        v[*inters.begin()].push_back(i), v[i].push_back(*inters.begin());
    }
    E += inters.size();
    if (inters.size() == 0) C++;
  }
  V = nrr - 1;
  for (int i = 1; i <= V; i++) {
    if (!use[i]) dfs(i), C++;
  }
  cout << E - V + C + 1 << '\n';
}
