#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<int,P> P1;
typedef pair<P,P> P2;
#define pu push
#define pb push_back
#define mp make_pair
#define eps 1e-7
#define INF 1000000000
#define mod 1000000007
#define fi first
#define sc second
#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define ERASE(x) x.erase(unique(x.begin(),x.end()),x.end())
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin())
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin())

typedef complex<double> pt;
typedef pair<pt,pt> L;
typedef vector<P> poly;
const double EPS = 1e-12;
#define x real()
#define y imag()
bool eq(double a,double b){
  return (-EPS < a-b && a-b < EPS);
}
bool eq(pt a,pt b){
    return eq(a.x,b.x) && eq(a.y,b.y);
}
double dot(pt a,pt b){
	return (conj(a)*b).x;
}
double cross(pt a,pt b){
	return (conj(a)*b).y;
}
int ccw(pt a,pt b,pt c){
	b -= a; c -= a;
	if(cross(b,c) > EPS) return 1; // counter clockwise
	if(cross(b,c) < -EPS) return -1; // clockwise
	if(dot(b,c) < -EPS) return 2; //c-a-b
	if(norm(b) < norm(c)) return -2; //a-b-c
	return 0; //a-c-b
}
bool cmp(const pt& a,const pt& b){
	if(-EPS < a.x-b.x && a.x-b.x < EPS) return a.y < b.y;
	else return a.x < b.x;
}
vector<pt>convex_hull(vector<pt>ps)
{
	sort(ps.begin(),ps.end(),cmp);
	int k=0,n = ps.size();
	vector<pt>qs(n*2);
	for(int i=0;i<n;i++)
	{
		while(k>1 && ccw(qs[k-2],qs[k-1],ps[i]) == -1) k--;
		qs[k++] = ps[i];
	}
	for(int i=n-2,t=k;i>=0;i--)
	{
		while(k>t && ccw(qs[k-2],qs[k-1],ps[i]) == -1) k--;
		qs[k++] = ps[i];
	}
	qs.resize(k-1);
	return qs;
}
//平行?
bool is_par(pt a,pt b,pt c,pt d){
    b -= a; d -= c;
	if(abs(b.y*d.x - b.x*d.y) < EPS){
		return 1;
	}
	return 0;
}

//直線同士
pt crossPoint(pt a,pt b,pt c,pt d){
	double A = cross(b-a,d-c);
	double B = cross(b-a,b-c);
	if( fabs(A) < EPS && fabs(B) < EPS ) return c;
	else if(fabs(A) >= EPS ) return c+B/A*(d-c);
	else return pt(1e9,1e9);
}
//線分同士の交点
bool on_segment(pair<pt,pt> a,pt p){
  return eq(abs(a.first-a.second)-abs(a.first-p)-abs(a.second-p),0);
}
//円 & 円 の交点
vector<pt> CCintersect (pair<pt,double> c, pair<pt,double> d) {
    vector<pt> ret;
    double dist = abs(c.first - d.first);
    double cr = c.second;
    double dr = d.second;
     
    if (dist > cr + dr) return ret;
    if (dist < abs(cr - dr)) return ret;
     
    double s = (cr + dr + dist) / 2.;
    double area = sqrt(s * (s - cr) * (s - dr) * (s - dist));
    double h = 2 * area / dist;
     
    pt v = d.first - c.first; v /= abs(v);
    pt m = c.first + sqrt(cr * cr - h * h) * v;
    pt n = v * pt(0, 1);
     
    ret.push_back(m + n * h);
    ret.push_back(m - n * h);
    return ret;
}
//線分a-b とc の距離
double dist_lp(pt a,pt b,pt c){
	if(dot(a-b,c-b) <= 0.0) return abs(c-b);
	if(dot(b-a,c-a) <= 0.0) return abs(c-a);
	return abs(cross(b-a,c-a)) / abs(b-a);
}
//線分が交わる?

bool intersect(pt a,pt b,pt c,pt d){
	return (ccw(a,b,c)*ccw(a,b,d) <= 0 && ccw(c,d,a)*ccw(c,d,b) <= 0);
}

int n;
pt xx[105],yy[105];

vector<pt>inct;

int main(){
	while(1){
		scanf("%d",&n);
		if(n == 0) return 0;
		for(int i=0;i<n;i++){
			double xa,ya,xb,yb;
			scanf("%lf%lf%lf%lf",&xa,&ya,&xb,&yb);
			xx[i] = pt(xa,ya);
			yy[i] = pt(xb,yb);
		}
		int ans = 1 + n;
		for(int i=0;i<n;i++){
		    inct.clear();
			for(int j=0;j<i;j++){
				if(eq(xx[i],xx[j]) || eq(xx[i],yy[j]) || eq(yy[i],xx[j]) || eq(yy[i],yy[j])) continue;
				if(intersect(xx[i],yy[i],xx[j],yy[j])){
				    pt r = crossPoint(xx[i],yy[i],xx[j],yy[j]);
				    rep(k,inct.size()){
				        if(abs(inct[k]-r) <= EPS){
				            goto fail;
				        }
				    }
				    inct.push_back(r) ; 
				    fail:;
				}
			}
			ans += inct.size();
		}
		printf("%d\n",ans);
	}
}


Measured memory_bytes: 3272