
#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
using namespace std;
set<pair<double,double> > cp;
pair<double,double> relv(pair<double,double> a,pair<double,double> b)
{
  return make_pair(a.first-b.first,a.second-b.second);
}
double cross(pair<double,double> va,pair<double,double> vb)
{
  return va.first*vb.second-va.second*vb.first;
}
void crosspoint(pair<double,double> a,pair<double,double> b,pair<double,double> c,pair<double,double> d)
{
  auto ab=relv(a,b),cd=relv(c,d);
  if(!(cross(ab,relv(a,c))*cross(ab,relv(a,d)) < 0 &&
       cross(cd,relv(c,a))*cross(cd,relv(c,b)) < 0)) return;
  double midrat=cross(cd,relv(c,a))/(cross(cd,relv(c,a))+cross(cd,relv(b,d)));
  //cout << midrat << ' ' << a.first << ' ' << b.first << ' ' << ab.first << ' ' << a.second << ' ' << b.second << ' ' << ab.second << endl;
  cp.insert(make_pair(a.first-midrat*ab.first,a.second-midrat*ab.second));
}

int main(void)
{
  for(;;){
    int n;
    cin >> n;
    if(!n) return 0;
    vector<pair<pair<double,double>,pair<double,double> > >line(n);
    cp.clear();
    REP(i,n) cin >> line[i].first.first
		 >> line[i].first.second
		 >> line[i].second.first
		 >> line[i].second.second;
    int answer=1;
    REP(i,n){
      cp.clear();
      REP(j,i) crosspoint(line[i].first,line[i].second,line[j].first,line[j].second);
      answer+=cp.size()+1;
    }
    cout << answer << endl;
  }
}