#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <cassert>
#include <iostream>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <bitset>
using namespace std;

#define repl(i,a,b) for(int i=(int)(a); i<(int)(b); i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<# x "="<<x<<endl

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;

#define INF 1000000000
#define EPS 1e-10

double a[100], b[100], c[100], d[100];

#define EQ(x,y) fabs((x)-(y))<(EPS)

inline double dist(double x1,double y1,double x2,double y2){
  return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}


int main(){
  int n;
  int cnt=1;
  while(cin>>n, n){
    rep(i,n){
      scanf("%lf %lf %lf %lf", &a[i], &b[i], &c[i], &d[i]);
    }

    int res=1;
    rep(i,n){
      // new line idx=i
      vector<pair<double, double> > cross;
      int adds=1;
      rep(j,i){
        // check if i and j have intersection point
        // => not paralell and inner square

        // is paralell ?
        if(EQ((a[i]-c[i])*(b[j]-d[j]), (a[j]-c[j])*(b[i]-d[i]))) continue;

        // calc intersection point
        double nx;
        double ny;
        if( EQ(a[i],c[i]) ){
          double dj = (b[j]-d[j])/(a[j]-c[j]);
          nx = a[i];
          ny = dj*(nx-a[j])+b[j];
        } else if( EQ(a[j],c[j]) ){
          double di = (b[i]-d[i])/(a[i]-c[i]);
          nx = a[j];
          ny = di*(nx-a[i])+b[i];
        } else {
          double di = (b[i]-d[i])/(a[i]-c[i]);
          double dj = (b[j]-d[j])/(a[j]-c[j]);
          nx = (b[j]-dj*a[j]-(b[i]-di*a[i]))/(di-dj);
          ny = di*(nx-a[i])+b[i];
          assert(EQ(ny, dj*(nx-a[j])+b[j]));
        }
        //      dbg(nx);dbg(ny);

        if(fabs(nx)-100.0<=-EPS && fabs(ny)-100.0<=-EPS){
	//if(-100<nx && nx<100 && -100<ny && ny<100){
          int reps=cross.size();
          bool flg=true;
          rep(k,reps){
            // new point is already added or not
	    if(EQ(cross[k].first, nx) && EQ(cross[k].second, ny)){
	      //if( dist(cross[k].first,cross[k].second,nx,ny)<EPS ){
              flg=false; break;
            }
          }
          if(flg){
            cross.pb(mp(nx,ny));
            adds++;
          }
        }

      }// rep  j
      //      dbg(adds);
      res += adds;
    }//rep i

    cout<<res<<endl;

  }
  return 0;
}