#include <bits/stdc++.h>   using std::vector;   const long double EPS = 1e-10;   int n;   int x[5], y[5], r[5];   inline int sqr(int x) { return x * x; }   namespace solver2 {   bool get(int a, int b) {     int dist2 = sqr(x[a] - x[b]) + sqr(y[a] - y[b]);     return dist2 < sqr(r[a] + r[b]) && dist2 > sqr(r[a] - r[b]);   }   bool in(int x0, int y0, int a) {     return (sqr(x0 - x[a]) + sqr(y0 - y[a])) < sqr(r[a]);   }   bool sta[10];   void main() {     int p = 240;     for (int i = 1; i <= n; i++) x[i] *= p, y[i] *= p, r[i] *= p;     for (int i = 1, x = -20 * p; i <= p * 40; i++, x++) {       for (int j = 1, y = -20 * p; j <= p * 40; j++, y++) {         int tmp = 0;         for (int k = 1; k <= n; k++) {           tmp += in(x, y, k) << (k - 1);         }         sta[tmp] = 1;       }     }     int ans = 1;     for (int i = 1; i < (1 << n); i++) ans += sta[i];     printf( %d n , ans);   }   }  // namespace solver2   namespace geometry {   inline long double sqr(long double x) { return x * x; }   inline int sgn(long double x) { return x < -EPS ? -1 : x > EPS; }   struct Vector {     long double x, y;     Vector(long double x = 0, long double y = 0) : x(x), y(y) {}     long double len() { return sqrt(sqr(x) + sqr(y)); }     long double norm() { return sqr(x) + sqr(y); }     Vector unit() { return *this / len(); }     long double angle() { return atan2(y, x); }     bool operator==(const Vector &rhs) const {       return sgn(x - rhs.x) == 0 && sgn(y - rhs.y) == 0;     }     bool operator<(const Vector &rhs) const {       return sgn(x - rhs.x) < 0 || (sgn(x - rhs.x) == 0 && sgn(y - rhs.y) < 0);     }     Vector operator+(const Vector &__rhs) const {       return Vector(x + __rhs.x, y + __rhs.y);     }     Vector operator-(const Vector &__rhs) const {       return Vector(x - __rhs.x, y - __rhs.y);     }     Vector operator*(const long double __rhs) const {       return Vector(x * __rhs, y * __rhs);     }     Vector operator/(const long double __rhs) const {       return Vector(x / __rhs, y / __rhs);     }   };   long double dot(Vector a, Vector b) { return a.x * b.x + a.y * b.y; }   long double cross(Vector a, Vector b) { return a.x * b.y - a.y * b.x; }   Vector rotate(Vector a, Vector b) {     b = b.unit();     return Vector(a.x * b.x - a.y * b.y, a.x * b.y + a.y * b.x);   }   struct Line {     Vector u;     Vector v;     Line() {}     Line(Vector a, Vector b) : u(a), v((b - a).unit()) {}   };   struct Circle {     Vector o;     long double r;     Circle() {}     Circle(Vector o, long double r) : o(o), r(r) {}   };   Vector mid_point(Vector a, Vector b) {     return Vector((a.x + b.x) / 2, (a.y + b.y) / 2);   }   Line divide_angle(Vector u, Vector v1, Vector v2) {     return Line(u, v1.unit() + v2.unit());   }   long double distance_to_line(Vector u, Line l) {     return fabs(cross(u - l.u, l.v)) / l.v.len();   }   Vector perpendicular_foot(Vector u, Line l) {     return l.u + l.v * dot(l.v, u - l.u);   }   Line move(Line l, long double d) {     return Line(l.u + rotate(l.v, Vector(0, 1)).unit() * d, l.v);   }   Vector intersection(Line l1, Line l2) {     return l1.u + l1.v * (cross(l2.v, l1.u - l2.u) / cross(l1.v, l2.v));   }   vector<Vector> intersection(Circle c1, Circle c2) {     if (sgn(c1.r - c2.r) < 0) std::swap(c1, c2);     long double d = (c1.o - c2.o).len();     if (sgn(c1.r + c2.r - d) < 0 || sgn(fabs(c1.r - c2.r) - d) > 0) {       return {};     } else if (sgn(c1.r + c2.r - d) == 0 || sgn(fabs(c1.r - c2.r) - d) == 0) {       return {c1.o + (c2.o - c1.o).unit() * c1.r};     } else {       long double cos_alpha = (sqr(d) + sqr(c1.r) - sqr(c2.r)) / (2 * d * c1.r);       long double sin_alpha = sqrt(1 - sqr(cos_alpha));       Vector delta1 = rotate(c2.o - c1.o, Vector(cos_alpha, sin_alpha)),              delta2 = rotate(c2.o - c1.o, Vector(cos_alpha, -sin_alpha));       return {c1.o + delta1.unit() * c1.r, c1.o + delta2.unit() * c1.r};     }   }   vector<Vector> intersection(Line l, Circle c) {     long double d = distance_to_line(c.o, l);     if (sgn(d - c.r) > 0) {       return {};     } else if (sgn(d - c.r) == 0) {       return {perpendicular_foot(c.o, l)};     } else {       Vector p = perpendicular_foot(c.o, l);       long double delta = sqrt(sqr(c.r) - sqr(d));       return {p + l.v * delta, p - l.v * delta};     }   }   }  // namespace geometry   using namespace geometry;   namespace solver1 {   bool get(int a, int b) {     int dist2 = sqr(x[a] - x[b]) + sqr(y[a] - y[b]);     return dist2 < sqr(r[a] + r[b]) && dist2 > sqr(r[a] - r[b]);   }   bool in(int x0, int y0, int a) {     return (sqr(x0 - x[a]) + sqr(y0 - y[a])) < sqr(r[a]);   }   bool sta[10];   void main() {     if (n == 1) {       puts( 2 );       return;     } else if (n == 2) {       if (get(1, 2)) {         puts( 4 );       } else         puts( 3 );       return;     } else {       Circle c[5];       for (int i = 1; i <= n; i++) c[i] = Circle(Vector(x[i], y[i]), r[i]);       vector<Vector> i12 = intersection(c[1], c[2]),                      i13 = intersection(c[1], c[3]),                      i23 = intersection(c[2], c[3]);       vector<Vector> p;       for (auto i : i12) p.push_back(i);       for (auto i : i13) p.push_back(i);       for (auto i : i23) p.push_back(i);       std::sort(p.begin(), p.end());       p.erase(std::unique(p.begin(), p.end()), p.end());       int cnt[5];       memset(cnt, 0, sizeof cnt);       for (auto i : p) {         for (int j = 1; j <= 3; j++) {           if (sgn((i - c[j].o).len() - r[j]) == 0) cnt[j]++;         }       }       int tot = 0;       for (int i = 1; i <= 3; i++) tot += cnt[i] ? cnt[i] : 1;       printf( %d , tot + 2 - std::max((int)p.size(), 1));     }   }   }  // namespace solver1   int main() {     scanf( %d , &n);     for (int i = 1; i <= n; i++) scanf( %d%d%d , &x[i], &y[i], &r[i]);     solver1::main();   }