#include <iostream>
#include <vector>
#include <cmath>
#include <map>

using namespace std;

double eps = 10e-10;

struct Point {
    double x, y;

    Point() {
        x = 0;
        y = 0;
    }

    Point(const double x_, const double y_) {
        x = x_;
        y = y_;
    }
};

struct Line {
    Point a, b;

    Line(const Point& a_, const Point& b_) {
        a = a_;
        b = b_;
    }
};

Point crossPoint(Line l, Line m) {
    double alpha = ((m.a.y - l.a.y) * (m.b.x - m.a.x) + (m.b.y - m.a.y) * (l.a.x - m.a.x)) / ((l.b.y - l.a.y) * (m.b.x - m.a.x) - (m.b.y - m.a.y) * (l.b.x - l.a.x));
    double x = l.a.x + alpha * (l.b.x - l.a.x);
    double y = l.a.y + alpha * (l.b.y - l.a.y);
    return Point(x, y);
}

double dist(Point p, Point q) {
    return sqrt(pow(p.x - q.x, 2) + pow(p.y - q.y, 2));
}

int main() {
    while (1) {
        int n;
        cin >> n;
        if (!n) break;

        vector<Line> lines;
        int n_area = 1;

        while (n--) {
            Point a, b;
            cin >> a.x >> a.y >> b.x >> b.y;
            Line l(a, b);

            int delta_area = 1;
            vector<Point> crosspts;
            for (size_t i = 0; i < lines.size(); ++i) {
                Point c = crossPoint(lines[i], l);
                if (!isfinite(c.x) || !isfinite(c.y)) continue;
                if (c.x <= -100 || 100 <= c.x || c.y <= -100 || 100 <= c.y) continue;

                bool found = false;
                for (size_t j = 0; j < crosspts.size(); ++j) {
                    if (dist(crosspts[j], c) < eps) {
                        found = true;
                        break;
                    }
                }
                if (!found) {
                    crosspts.push_back(c);
                    delta_area++;
                }
            }
            n_area += delta_area;

            lines.push_back(l);
        }

        cout << n_area << endl;
    }
}