#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

#define rep(i,x) for(int i = 0 ; i < x ; i ++)
#define rep1(i,x) for(int i = 1 ; i <= x ; i ++)

typedef long double ld;
const ld PI = 3.141592653589793238462643383279;

struct po{
	ld x;
	ld y;
	po(ld a){ x = a; y = 0; }
	po(ld a,ld b){ x = a; y = b; }
	po(){}
	inline ld operator()(const po& rhs) const {
		return x*rhs.x+y*rhs.y;
	}
	inline ld norm() {
		return sqrt((*this)(*this));
	}
	inline po& operator+=(const po& rhs){
		x += rhs.x;
		y += rhs.y;
		return *this;
	}
	inline po& operator-=(const po& rhs){
		x -= rhs.x;
		y -= rhs.y;
		return *this;
	}
	inline po& operator*=(const po& rhs){
		ld x_ = x*rhs.x-y*rhs.y;
		y = x*rhs.y+y*rhs.x;
		x = x_;
		return *this;
	}
	inline po& operator/=(const po& rhs){
		ld x_ = x*rhs.x+y*rhs.y;
		y = -x*rhs.y+y*rhs.x;
		x = x_;
		ld nor = rhs(rhs);
		x /= nor;
		y /= nor;
		return *this;
	}
	inline void in(){
		scanf("%Lf%Lf",&x,&y);
	}
};
inline po operator+(const po& a, const po& b){ return po(a) += b; }
inline po operator-(const po& a, const po& b){ return po(a) -= b; }
inline po operator*(const po& a, const po& b){ return po(a) *= b; }
inline po operator/(const po& a, const po& b){ return po(a) /= b; }

inline po similar(const po& a,const po& b,const po& c,const po& p,const po& q){
	return p+(q-p)*(c-a)/(b-a);
}

typedef pair<po,po> se;
#define fr first
#define sc second

struct li{
	ld a;
	ld b;
	ld c;
	li(po p,po q){
		a = q.y-p.y;
		b = p.x-q.x;
		c = p.y*q.x-p.x*q.y;
	}
	/*explicit li(se s){
		a = s.sc.y-s.fr.y;
		b = s.fr.x-s.sc.x;
		c = s.fr.y*s.sc.x-s.fr.x*s.sc.y;
		li(s.fr,s.sc);
	}*/
	li(){}
	inline ld operator()(const po& p) const {
		return a*p.x+b*p.y+c;
	}
};

void intersect(const li &l,const li &m,po* &ret){
	if(abs(l.a*m.b-m.a*l.b) <= 1e-18){
		ret = nullptr;
		return;
	}
	ret = new po;
	ret->x = -(l.c*m.b-m.c*l.b)/(l.a*m.b-m.a*l.b);
	ret->y = -(l.a*m.c-m.a*l.c)/(l.a*m.b-m.a*l.b);
}
inline bool on(const po &p,const se &s){
	return (s.fr-p)(s.sc-p) <= 1e-9;
}
void intersect(const se &s,const se &t,po* &ret){
	li l = li(s.fr,s.sc);
	li m = li(t.fr,t.sc);
	po *p;
	intersect(l,m,p);
	if(p == nullptr || (on(*p,s)&&on(*p,t)))ret = p;
	else{
		delete p;
		ret = nullptr;
	}
}
inline ld dist(const po &p,const po &q){
	return sqrt((p-q)(p-q));
}

int main(){
	int n;
	while(1){
		scanf("%d",&n);
		if(n == 0)break;
		po p[102],q[102];
		rep1(i,n){
			p[i].in();
			q[i].in();
		}
		int ret = 1;
		rep1(i,n){
			vector<po> vec;
			rep1(j,i-1){
				po *_p;
				intersect(se(p[i],q[i]),se(p[j],q[j]),_p);
				if(_p != nullptr){
					if(max(abs(_p->x),abs(_p->y))-100.0 < -1e-12){
						vec.push_back(*_p);
					}
					delete _p;
				}
			}
			rep(i,vec.size()){
				bool b = true;
				rep(j,i){
					if(dist(vec[i],vec[j]) <= 1e-12)b = false;
				}
				if(b)ret ++;
			}
			ret ++;
		}
		printf("%d\n",ret);
	}
}


