#include <iostream>
#include <vector>
#include <algorithm>
#include <complex>

using namespace std;

typedef complex<double> Point;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define all(c) (c).begin(), (c).end()
const double eps = 1e-10;

template<typename T>
inline void uniq(T& c){sort(all(c)); c.erase(unique(all(c)), c.end());}

namespace std {
    bool operator<(const Point& a, const Point& b){
        return make_pair(a.real(), a.imag()) < make_pair(b.real(), b.imag());
    }
    bool operator==(const Point& a, const Point& b){
        return abs(a - b) < eps;
    }
};

inline double cross(const Point& a, const Point& b){
    return imag(conj(a) * b);
}

inline double dot(const Point& a, const Point& b){
    return real(conj(a) * b);
}

int ccw(Point a, Point b, Point c){
    b -= a; c -= a;
    if(cross(b, c) > eps)return 1;
    if(cross(b, c) < -eps)return -1;
    if(dot(b, c) < 0)return 2;
    if(norm(b) < norm(c))return -2;
    return 0;
}

struct Line : vector<Point> {
    Line(const Point& a, const Point& b):vector<Point>{a, b}{}
};

inline bool interSS(const Line& s, const Line& t){
    return ccw(s[0], s[1], t[0]) * ccw(s[0], s[1], t[1]) <= 0 &&
           ccw(t[0], t[1], s[0]) * ccw(t[0], t[1], s[1]) <= 0;
}

Point xptLL(const Line& l, const Line& m){
    double d = cross(l[1] - l[0], m[1] - m[0]);
    if(abs(d) < eps)return Point(~0, ~0);
    return m[0] + (m[1] - m[0]) * cross(l[1] - l[0], l[1] - m[0]) * (1. / d);
}

inline bool eq(const double a, const double b){
    return abs(a - b) < eps;
}

int solve(vector<Line>& ls){
    int res = 1;
    rep(i, (int)ls.size()){
        vector<Point> ps;
        rep(j, i){
            if(!interSS(ls[i], ls[j]))continue;
            Point xpt = xptLL(ls[i], ls[j]);
            if(eq(abs(xpt.real()), 100) || eq(abs(xpt.imag()), 100))continue;
            ps.push_back(xpt);
        }
        uniq(ps);
        res += (int)ps.size() + 1;
    }
    return res;
}

int main(){
    int n;
    while(cin >> n, n){
        vector<Line> ls;
        rep(i, n){
            int x1, y1, x2, y2;
            cin >> x1 >> y1 >> x2 >> y2;
            ls.emplace_back(Point(x1, y1), Point(x2, y2));
        }
        cout << solve(ls) << '\n';
    }
    return 0;
}