#include<bits/stdc++.h>
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
#define EPS (1e-10)

int N;
vector<L> S;

double dot(P a,P b) { return real(conj(a)*b); }
double cross(P a,P b ){ return imag(conj(a)*b); }

int ccw(P a,P b, P c){
  b-=a;
  c-=a;
  if( cross( b,c ) > EPS ) return 1;
  if( cross( b,c ) < -EPS ) return -1;
  if( dot(b,c) < -EPS ) return 2;
  if( norm(b) < norm(c) ) return -2;
  return 0;      
}

bool equalPoint( P a, P b ){
  if( abs( a-b ) < EPS ) return true;
  return false;
}


bool isIntersect(L s1, L s2 ) {
  if( max( real(s1.first), real(s1.second)) + EPS < min( real(s2.first), real(s2.second) ) ||
      max( imag(s1.first), imag(s1.second)) + EPS < min( imag(s2.first), imag(s2.second) ) ||
      max( real(s2.first), real(s2.second)) + EPS < min( real(s1.first), real(s1.second) ) ||
      max( imag(s2.first), imag(s2.second)) + EPS < min( imag(s1.first), imag(s1.second) ) ) return false;

  if(equalPoint(s1.first,s2.first) || equalPoint(s1.first,s2.second) ||
     equalPoint(s1.second,s2.first) || equalPoint(s1.second,s2.second) ) return false;
  return ( ccw(s1.first, s1.second, s2.first) * ccw(s1.first , s1.second, s2.second) <= 0 &&
	   ccw(s2.first, s2.second, s1.first) * ccw(s2.first , s2.second, s1.second) <= 0 );
}


P crossPoint(L l,L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if ( fabs( A ) < EPS && fabs( B ) < EPS ) return m.first;
  else if ( fabs(A) >= EPS ) return m.first + B/ A * (m.second - m.first);
}

int res;

void check(L s){
  vector<P> flag;
  for(int i=0;i<(int)S.size();i++){
    if( isIntersect( S[i], s ) ) {
      P a = crossPoint(S[i],s);
      bool f = false;
      for(int j=0;j<(int)flag.size();j++){
	if( equalPoint(flag[j],a) ) f = true;
	if( f ) break;
      }
      if( f ) continue;
      flag.push_back(a);
      // cout << " i "<<res << endl;
      res++;
    }
  }
}

int main() {
  while( cin >> N && N ){
    res = 1;
    for(int i=0;i<N;i++){
      res++;
      int x1, y1, x2, y2;
      cin >> x1 >> y1 >> x2 >> y2;
      L s = L( P((double)x1,(double)y1) , P((double)x2,(double)y2) );
      check( s );
      S.push_back( s );
    }
    S.clear();
    cout << res << endl;
  }
}