#include <bits/stdc++.h>
using namespace std;

typedef ostringstream OSS;
typedef istringstream ISS;

typedef long long LL;
typedef pair<int, int> PII;

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef vector<VS> VVS;
typedef vector<bool> VB;
typedef vector<VB> VVB;
typedef vector<PII> VPII;

#define fst first
#define snd second
#define MP make_pair
#define PB push_back
#define EB emplace_back 
#define ALL(x) (x).begin(),(x).end()
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

template < typename T > inline T fromString(const string &s) { T res; ISS iss(s); iss >> res; return res; };
template < typename T > inline string toString(const T &a) { OSS oss; oss << a; return oss.str(); };

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};


const double EPS = 1e-12;

double add(double a, double b) {
	if (abs(a + b) < EPS * (abs(a) + abs(b)))
		return 0;
	return a + b;
}

bool eq(double a, double b) {
    return abs(a - b) < EPS;
}

struct P {
	double x, y;
	P() {};
	P(double x_, double y_) : x(x_), y(y_) {
	}

	P operator + (P p) {
		return P(add(x, p.x), add(y, p.y));
	}

	P operator - (P p) {
		return P(add(x, -p.x), add(y, -p.y));
	}

	P operator * (double d) {
		return P(x * d, y * d);
	}

	P operator / (double d) {
		return P(x / d, y / d);
	}

    bool operator < (const P &p) const {
        return MP(x, y) < MP(p.x, p.y);
    }

    bool operator > (const P &p) const {
        return MP(x, y) > MP(p.x, p.y);
    }

    bool eq(P p) {
        return ::eq(x, p.x) && ::eq(y, p.y);
    }

	// ??????
	double dot(P p) {
		return add(x * p.x, y * p.y);
	}

	// ??????
	double det(P p) {
		return add(x * p.y, -y * p.x);
	}
};

// ???????????????????????????
bool on_seg(P p1, P p2, P q) {
	return (p1 - q).det(p2 - q) == 0 && (p1 - q).dot(p2 - q) <= 0;
}

// ??´?????¨??´????????????
P intersection(P p1, P p2, P q1, P q2) {
	return p1 + (p2 - p1) * ((q2 - q1).det(q1 - p1) / (q2 - q1).det(p2 - p1));
}

// ????????¨?????????????????£????????????
bool is_cross(P p1, P p2, P q1, P q2) {
    P a = intersection(p1, p2, q1, q2);
    return on_seg(p1, p2, a) && on_seg(q1, q2, a);
}

struct Line {
    P p, q;
};

// ????????¨?????????????????\?????§????????£????????????(line)
bool is_cross(Line a, Line b) {
    P p = intersection(a.p, a.q, b.p, b.q);
    return on_seg(a.p, a.q, p) && on_seg(b.p, b.q, p) &&
        !a.p.eq(p) && !a.q.eq(p) &&
        !b.p.eq(p) && !b.q.eq(p);
}

vector<P> uniq(vector<P> &ps) {
    sort(ALL(ps));
    vector<P> ys;

    if (!ps.size()) { return ys; }

    P p = ps[0];
    ys.PB(p);

    for (int i = 1; i < (int)ps.size(); i++) {
        if (!p.eq(ps[i])) {
            p = ps[i];
            ys.PB(p);
        }
    }

    return ys;
}

void solve(int n) {
    vector<Line> ls(n);
    for (auto &l : ls) {
        cin >> l.p.x >> l.p.y >> l.q.x >> l.q.y;
    }

    ///

    int cnt = 1;

    for (int i = 0; i < n; i++) {
        vector<P> cps;
        for (int j = 0; j < i; j++) {
            if (is_cross(ls[i], ls[j])) {
                P cross_p = intersection(ls[i].p, ls[i].q, ls[j].p, ls[j].q);
                cps.PB(cross_p);
            }
        }
        cnt += uniq(cps).size() + 1;
    }

    cout << cnt << endl;
}

int main(void) {
    int n;
    while (cin >> n, n) {
        solve(n);
    }

    return 0;
}

Measured memory_bytes: 1252