#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MOD = 1000000007;

const double EPS = 1e-10;

typedef complex<double> P;
namespace std {
  bool operator < (const P& a, const P& b) {
    // if (abs(a-b)<EPS) return 0;
    return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
  }
}

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

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

struct L : public vector<P> {
  L(const P &a, const P &b) {
    push_back(a); push_back(b);
  }
  L() {}
};

bool intersectLL(const L &l, const L &m) {
  return abs(cross(l[1]-l[0], m[1]-m[0])) > EPS || // non-parallel
         abs(cross(l[1]-l[0], m[0]-l[0])) < EPS;   // same line
}

P crosspoint(const L &l, const L &m) {
  double A = cross(l[1] - l[0], m[1] - m[0]);
  double B = cross(l[1] - l[0], l[1] - m[0]);
  if (abs(A) < EPS && abs(B) < EPS) return m[0]; // same line
  if (abs(A) < EPS) assert(false); // !!!PRECONDITION NOT SATISFIED!!!
  return m[0] + B / A * (m[1] - m[0]);
}

int main(){
    while(true){
        int N;
        cin >> N;
        if(N == 0) break;

        vector<L> lines;
        int ans = 1;
        for(int i=0;i<N;i++){
            int x1, y1, x2, y2;
            cin >> x1 >> y1 >> x2 >> y2;
            P p1(x1, y1), p2(x2, y2);

            L new_line(p1, p2);
            vector<P> cross_points;
            for(L& line : lines){
                if(intersectLL(new_line, line)){
                    P p = crosspoint(new_line, line);
                    if(-100 < real(p) && real(p) < 100 && -100 < imag(p) && imag(p) < 100){
                        bool exist = false;
                        for(P& ap : cross_points){
                            if(abs(ap - p) < EPS){
                                exist = true;
                                break;
                            }
                        }
                        if(!exist){
                            cross_points.push_back(p);
                        }
                    }
                }
            }
            ans += cross_points.size() + 1;
            lines.push_back(new_line);
        }
        cout << ans << endl;
    }

    return 0;
}