Problem: Do you know confetti? They are small discs of colored paper, and people throw them around during parties or festivals. Since people throw lots of confetti, they may end up stacked one on another, so there may be hidden ones underneath.

A handful of various sized confetti have been dropped on a table. Given their positions and sizes, can you tell us how many of them you can see?

The following figure represents the disc configuration for the first sample input, where the bottom disc is still visible.

<image>



Input

The input is composed of a number of configurations of the following form.


n 		
x1 y1 z1
x2 y2 z2
.
.
.
xn yn zn


The first line in a configuration is the number of discs in the configuration (a positive integer not more than 100), followed by one Ine descriptions of each disc: coordinates of its center and radius, expressed as real numbers in decimal notation, with up to 12 digits after the decimal point. The imprecision margin is ±5 × 10-13. That is, it is guaranteed that variations of less than ±5 × 10-13 on input values do not change which discs are visible. Coordinates of all points contained in discs are between -10 and 10.

Confetti are listed in their stacking order, x1 y1 r1 being the bottom one and xn yn rn the top one. You are observing from the top.

The end of the input is marked by a zero on a single line.

Output

For each configuration you should output the number of visible confetti on a single line.

Example

Input

3
0 0 0.5
-0.9 0 1.00000000001
0.9 0 1.00000000001
5
0 1 0.5
1 1 1.00000000001
0 2 1.00000000001
-1 1 1.00000000001
0 -0.00001 1.00000000001
5
0 1 0.5
1 1 1.00000000001
0 2 1.00000000001
-1 1 1.00000000001
0 0 1.00000000001
2
0 0 1.0000001
0 0 1
2
0 0 1
0.00000001 0 1
0


Output

3
5
4
2
2

Solution (in CPP):

Solution:
#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;

double eps = 1e-14;
bool eq(double a,double b){
  return (-eps<a-b&&a-b<eps);
}
bool eq(P a,P b){
  return eq(a.real(),b.real())&&eq(a.imag(),b.imag());
}
P getCrossPointCC(P p1,double r1,P p2,double r2,bool flag=false){
  double a=r2,b=r1,c=abs(p1-p2);
  double cos_A = (b*b+c*c-a*a) / (2.0*b*c);
  double zero=0;
  double sin_A = sqrt( max(zero,1.0-cos_A*cos_A));
  P v=(p2-p1);
  v *= r1;
  v /= c;
  return p1+v*P(cos_A,sin_A);
}

bool isCross(P p1,double r1,P p2,double r2){
  double k=abs(p1-p2);
  if( r1+r2 < k - eps )return false;
  if( k+r1 < r2 - eps)return false;
  if( k+r2 < r1 - eps)return false;
  return true;
}

int n;
P t[200];
double r[200];
vector< P > u,v;


bool check(P p,double r){
  bool res=false;
  v.clear();
  for(int i=0;i<(int)u.size();i++){
    P k=u[i];
    //printf("%.8f %.8f\n",k.real(),k.imag());
    if( abs(p-k) < r + eps )res=true;
    if( abs(p-k) > r - eps )v.push_back(k);
  }
  u=v;
  return res;
}

int main(){
  while(1){
    u.clear(),v.clear();
    cin>>n;
    if(n==0)break;
    for(int i=0;i<n;i++){
      double x,y;
      cin>>x>>y>>r[i];
      t[i]=P(x,y);
      u.push_back(t[i]);
      u.push_back( P(t[i].real(),t[i].imag()+r[i]) );
    }
    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
        if(isCross(t[i],r[i],t[j],r[j])){
          u.push_back(getCrossPointCC(t[i],r[i],t[j],r[j]));
          u.push_back(getCrossPointCC(t[j],r[j],t[i],r[i]));
        }
      }
    }
    //    cout<<u.size()<<endl;
    int ans=0;
    for(int i=n-1;i>=0;i--){
      if(check(t[i],r[i]))ans++;
    }
    cout<<ans<<endl;
  }
  return 0;
}