#include "bits/stdc++.h"

using namespace std;

typedef long double ld;
typedef complex<ld> Point;

const ld eps = 1e-9, pi = acos(-1.0);

namespace std {
	bool operator<(const Point &lhs, const Point &rhs) {
		if (lhs.real() < rhs.real() - eps) return true;
		if (lhs.real() > rhs.real() + eps) return false;
		return lhs.imag() < rhs.imag();
	}
}

Point input_point() {
	ld x, y;
	cin >> x >> y;
	return Point(x, y);
}

bool eq(ld a, ld b) {
	return (abs(a - b) < eps);
}

// dot of a and b
ld dot(Point a, Point b) {
	return real(conj(a) * b);
}

// cross of a and b
ld cross(Point a, Point b) {
	return imag(conj(a) * b);
}

class Line {
public:
	Point a, b;
	Line() : a(Point(0, 0)), b(Point(0, 0)) {}
	Line(Point a, Point b) : a(a), b(b) {}
};

// CCW::counter clockwise
int ccw(Point a, Point b, Point c) {
	b -= a; c -= a;
	if (cross(b, c) > eps) return 1;   // a,b,c : counter-clockwise
	if (cross(b, c) < -eps) return -1; // a,b,c : clockwise
	if (dot(b, c) < 0) return 2;       // c,a,b : on a line
	if (norm(b) < norm(c)) return -2;  // a,b,c : on a line
	return 0;                          // a,c,b : on a line
}

bool isis_ss(Line s, Line t) {
	return ccw(s.a, s.b, t.a) * ccw(s.a, s.b, t.b) <= 0 &&
		ccw(t.a, t.b, s.a) * ccw(t.a, t.b, s.b) <= 0;
}

Point proj(Line l, Point p) {
	ld t = dot(p - l.a, l.a - l.b) / norm(l.a - l.b);
	//norm::��Βl��2��
	return l.a + t * (l.a - l.b);
}

Point is_ll(Line s, Line t) {
	Point sv = s.b - s.a, tv = t.b - t.a;
	assert(cross(sv, tv) != 0);
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}

bool isis_sp(Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}

ld dist_sp(Line s, Point p) {
	Point r = proj(s, p);
	return isis_sp(s, r) ? abs(r - p) : min(abs(s.a - p), abs(s.b - p));
}

bool check(Point p){ // p on the square?
    bool f=false;
    Point left_d=Point(-100,-100),left_u=Point(-100,100);
    Point right_d=Point(100,-100),right_u=Point(100,100);
    if(dist_sp(Line(left_d,left_u),p)<1e-10) f=true;
    if(dist_sp(Line(left_u,right_u),p)<1e-10) f=true;
    if(dist_sp(Line(right_u,right_d),p)<1e-10) f=true;
    if(dist_sp(Line(right_d,left_d),p)<1e-10) f=true;
    return f;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n;
    while(cin>>n,n){
        vector<Line> ls;
        int res=1;
        for(int i=0;i<n;i++){
            res++;
            
            Point st=input_point(),gt=input_point();
            Line l=Line(st,gt);
            vector<Point> inter;
            
            for(int j=0;j<i;j++){
                if(!isis_ss(ls[j],l)) continue;
                Point p=is_ll(ls[j],l);
                inter.push_back(p);
            }

            ls.push_back(l);
            int sz=inter.size();
            if(sz==0) continue;

            sort(inter.begin(),inter.end());
            vector<Point> cand;
            cand.push_back(inter[0]);
            for(int j=1;j<sz;j++){
                if(abs(inter[j]-inter[j-1])<1e-10) continue;
                cand.push_back(inter[j]);
            }

            sz=cand.size();
            for(int j=0;j<sz;j++) if(!check(cand[j])) res++;
        }
        cout<<res<<endl;
    }
}


Measured memory_bytes: 3320