#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<vector>
using namespace std;
double X1[110];
double X2[110];
double Y1[110];
double Y2[110];
double eps=1e-11;
double ABS(double a){return max(a,-a);}
double dist(pair<double,double>a,pair<double,double>b){
	return sqrt((a.first-b.first)*(a.first-b.first)+(a.second-b.second)*(a.second-b.second));
}
int main(){
	int a;
	while(scanf("%d",&a),a){
		for(int i=0;i<a;i++){
			scanf("%lf%lf%lf%lf",X1+i,Y1+i,X2+i,Y2+i);
		}
		int ret=1;
		for(int i=0;i<a;i++){
			vector<pair<double,double> >v;
			for(int j=0;j<i;j++){
				if(ABS((X2[i]-X1[i])*(Y2[j]-Y1[j])-(X2[j]-X1[j])*(Y2[i]-Y1[i]))<eps)continue;
				double a1=Y2[i]-Y1[i];
				double a2=Y2[j]-Y1[j];
				double b1=X1[i]-X2[i];
				double b2=X1[j]-X2[j];
				double c1=Y1[i]*(X2[i]-X1[i])-X1[i]*(Y2[i]-Y1[i]);
				double c2=Y1[j]*(X2[j]-X1[j])-X1[j]*(Y2[j]-Y1[j]);
				double det=a1*b2-a2*b1;
				double x=-(b1*c2-b2*c1)/det;
				double y=-(a2*c1-a1*c2)/det;
				if(x<-100.0+eps||y<eps-100.0||x>100.0-eps||y>100.0-eps)continue;
				v.push_back(make_pair(x,y));
			}
			ret++;
			//for(int j=0;j<v.size();j++)printf("%f %f\n",v[j].first,v[j].second);
			//printf("\n");
			for(int j=0;j<v.size();j++){
				bool ok=true;
				for(int k=0;k<j;k++){
					if(dist(v[j],v[k])<eps){ok=false;break;}
				}
				if(ok)ret++;
			}
		}
		printf("%d\n",ret);
	}
}