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

#define rep(i, n) for (int i = 0; i < (n); i ++)

struct point { double y, x; };
struct segment { point s, t; };
struct line { point s, t; };

const double eps = 1e-6;

point operator + (point a, point b) { return (point) { a.y + b.y, a.x + b.x }; }
point operator - (point a, point b) { return (point) { a.y - b.y, a.x - b.x }; }
point operator * (point a, double b) { return (point) { a.y * b, a.x * b }; }
point operator * (double b, point a) { return (point) { a.y * b, a.x * b }; }
double cross(point a, point b) { return a.x * b.y - a.y * b.x; }
double   dot(point a, point b) { return a.x * b.x + a.y * b.y; }
int ccw(point a, point b, point c) { double z = cross(b - a, c - a); return z > eps ? 1 : z < - eps ? -1 : 0; }
bool does_intersect(segment const & a, segment const & b){
    return ccw(a.s, a.t, b.s) * ccw(a.s, a.t, b.t) < 0 and
           ccw(b.s, b.t, a.s) * ccw(b.s, b.t, a.t) < 0;
}
point intersection(line a, line b) {
    double p = cross(a.t - a.s, b.t - b.s);
    double q = cross(a.t - a.s, a.t - b.s);
    return (q / p) * (b.t - b.s) + b.s;
}
line to_line(segment a) {
    return { a.s, a.t };
}
point intersection(segment a, segment b) {
    if (!does_intersect(a, b)) return (point){ 1010101010, 1010101010 };
    return intersection(to_line(a), to_line(b));
}
double sq(double x) { return pow(x, 2); }
double distance(point a, point b) { return sqrt(sq(a.y - b.y) + sq(a.x - b.x)); }
bool same(point a, point b) {
        double d = distance(a, b);
        if (d < eps) return true;
        return false;
}
bool does_intersect(point a, segment b) {
    return abs(cross(b.t - b.s, a - b.s)) < eps
        and dot(b.t - b.s, a - b.s) > - eps
        and dot(b.s - b.t, a - b.t) > - eps;
}

int main() {
        int n;
        while (cin >> n && n) {
                vector<segment> ln;
                rep(i, n) {
                        double x1, y1, x2, y2;
                        cin >> x1 >> y1 >> x2 >> y2;
                        segment l;
                        l.s.x = x1;
                        l.s.y = y1;
                        l.t.x = x2;
                        l.t.y = y2;
                        ln.push_back(l);
                }
                vector<point> p;
                for (int i = 0; i < ln.size() - 1; i ++) {
                        for (int j = i + 1; j < ln.size(); j ++) {
                                point inter = intersection(ln[i], ln[j]);
                                if (inter.y == 1010101010 && inter.x == 1010101010) continue;
                                p.push_back(inter);
                        }
                }
                //rep(i, p.size()) cout << p[i].y << ' ' << p[i].x << endl;
                vector<bool> willuse(p.size(), true);
                for (int i = 0; i < p.size(); i ++) {
                        for (int j = i + 1; j < p.size(); j ++) {
                                if (same(p[i], p[j])) willuse[j] = false;
                        }
                }
                vector<point> unip;
                for (int i = 0; i < p.size(); i ++) {
                        if (willuse[i]) unip.push_back(p[i]);
                }
                int ans = n + 1;
                rep(i, unip.size()) {
                        int cnt = 0;
                        rep(j, ln.size()) {
                                if (does_intersect(unip[i], ln[j])) cnt ++;
                        }
                        ans += cnt - 1;
                }
                cout << ans << endl;
        }
        return 0;
}

Measured memory_bytes: 3424