#include<iostream>
#include<cfloat>
#include<cassert>
#include<cmath>
#include<cstdio>
#include<vector>
#include<set>
#include<algorithm>

using namespace std;

#define EPS (1e-15)
#define equals(a, b) (fabs((a) - (b)) < EPS )
#define dle(a, b) (equals(a, b) || a < b )
static const double PI = acos(-1);

class Point{
public:
  double x, y;

  Point ( double x = 0, double y = 0): x(x), y(y){}

  Point operator + ( Point p ){ return Point(x + p.x, y + p.y); }
  Point operator - ( Point p ){ return Point(x - p.x, y - p.y); }
  Point operator * ( double a ){ return Point(x*a, y*a); }
  Point operator / ( double a ){ return Point(x/a, y/a); }
  Point operator / ( Point p ) { return Point((x*p.x+y*p.y)/(p.x*p.x+p.y*p.y), (y*p.x-x*p.y)/(p.x*p.x+p.y*p.y)); }
   
  double abs() { return sqrt(norm());}
  double norm() { return x*x + y*y; }

  bool operator < ( const Point &p ) const {
    return x != p.x ? x < p.x : y < p.y;
  }

  bool operator == ( const Point &p ) const {
    return fabs(x-p.x) < EPS && fabs(y-p.y) < EPS;
  }
};

typedef Point Vector;


class Segment{
public:
  Point p1, p2;
  Segment(Point s = Point(), Point t = Point()): p1(s), p2(t){}

};

typedef Segment Line;

static const int CIRCLE_NON = 0;
static const int CIRCLE_OUT = 1;
static const int CIRCLE_IN = 2;
static const int CIRCLE_CROSS = 3;

class Circle{
public:
  Point c;
  double r;
  Circle(Point c = Point(), double r = 0.0): c(c), r(r){}
};

double norm( Vector a ){ return a.x*a.x + a.y*a.y; }
double abs( Vector a ){ return sqrt(norm(a)); }
Point polar( double a, double r ){ return Point(cos(r)*a, sin(r)*a);}
double getDistance( Vector a, Vector b ){ return abs(a - b); }
double dot( Vector a, Vector b ){ return a.x*b.x + a.y*b.y; }
double cross( Vector a, Vector b ){ return a.x*b.y - a.y*b.x; }

Point project( Segment s, Point p ){
  Vector base = s.p2 - s.p1;
  double t = dot(p - s.p1, base)/norm(base);
  return s.p1 + base*t;
}

double getAngle(Point p){
  double polar = atan2(p.y, p.x);
  return (dle(0, polar))? polar : 2.0*acos(-1)+polar;
}

int isIntersect(Circle c1, Circle c2){
  double d = abs(c1.c - c2.c);
  if ( c1.r + c2.r < d ) return CIRCLE_NON; // no overlap
  if ( d + c2.r < c1.r ) return CIRCLE_IN;  // c1 includes c2
  if ( d + c1.r < c2.r ) return CIRCLE_OUT;  // c2 includes c1
  return CIRCLE_CROSS;
}

double getDistanceLP(Line s, Point p){
  return abs(cross(s.p2 - s.p1, p - s.p1)/abs(s.p2 - s.p1));
}

double arg(Vector p){
  return atan2(p.y, p.x);
}

pair<Point, Point> getCrossPoints(Circle c1, Circle c2){
  assert( isIntersect( c1, c2 ) );
  double d = abs(c1.c - c2.c);
  double a = acos((c1.r*c1.r+d*d-c2.r*c2.r)/(2*c1.r*d));
  double t = arg(c2.c - c1.c);
  return make_pair(c1.c+polar(c1.r, t+a), c1.c+polar(c1.r, t-a));
}

bool isIntersect( Circle c1, Line l ){
  double d = getDistanceLP(l, c1.c);
  return ( equals(d, c1.r) || d < c1.r );
}

pair<Point, Point> getCrossPoints(Circle c, Line l ){
  assert( isIntersect( c, l ) );
  Vector pr = project(l, c.c);
  Vector e = (l.p2 - l.p1)/abs(l.p2 - l.p1);
  double base = sqrt(c.r*c.r - norm(pr-c.c));
  return make_pair(pr + e*base, pr - e*base);
}

Circle C[100];
int n;

void compute(){
  vector<Point> candidates;
  vector<double> Y;  

  Y.push_back(-100.0);
  Y.push_back(100.0);

  for ( int i = 0; i < n; i++ ){
    Y.push_back(C[i].c.y - C[i].r);
    Y.push_back(C[i].c.y + C[i].r);
  }
  
  for ( int i = 0; i < n-1; i++ ){
    for ( int j = i+1; j < n; j++ ){
      if ( isIntersect(C[i], C[j]) != CIRCLE_CROSS ) continue;
      pair<Point, Point> pp = getCrossPoints(C[i], C[j]);
      Y.push_back(pp.first.y);
      Y.push_back(pp.second.y);
    }
  }

  sort(Y.begin(), Y.end());

  for ( int k = 0; k < Y.size()-1; k++ ){
    double my = (Y[k+1] + Y[k])/2;
    Line l = Line(Point(-100, my), Point(100, my));
    vector<double> X;
    X.push_back(-100);
    X.push_back(100);
    for ( int i = 0; i < n; i++ ){
      if ( !isIntersect(C[i], l) ) continue;
      pair<Point, Point> pp = getCrossPoints(C[i], l);
      X.push_back(pp.first.x);
      X.push_back(pp.second.x);
    }
    sort(X.begin(), X.end());

    for ( int i = 0; i < X.size()-1; i++ ){
      candidates.push_back(Point((X[i+1]+X[i])/2, my));
    }
  }

  int ans = 0;
  for ( int i = 0; i < n; i++ ){
    for ( int c = 0; c < candidates.size(); c++ ){
      Point t = candidates[c];
      bool f = true;
      if ( abs(C[i].c - t) > C[i].r ) {
	continue;
      }
      for ( int j = i+1; j < n; j++ ){
	if ( dle(abs(C[j].c - t), C[j].r) ) {
	  f = false;
	  break;
	}
      }
      if ( f ) {
	ans++;
	break;
      }
    }
  }

  printf("%d\n", ans);
}

int main(){
  double x, y, r;
  while(1){
    cin >> n;
    if ( n == 0 ) break;
    for ( int i = 0; i < n; i++ ){
      cin >> x >> y >> r; C[i] = Circle( Point(x, y), r);
    }
    compute();
  }

  return 0;
}