//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);


struct P{
  double x, y;
};

bool operator<(const P& p1, const P& p2){
  return p1.x+EPS < p2.x || (abs(p1.x - p2.x) < EPS && p1.y+EPS < p2.y);
}

P operator-(const P& p1, const P& p2){
  P d;
  d.x = p1.x - p2.x;
  d.y = p1.y - p2.y;
  return d;
}

bool operator==(const P& p1, const P& p2){
  return abs(p1.x - p2.x) < EPS && abs(p1.y - p2.y) < EPS;
}

double cross(const P& p1, const P& p2){
  return p1.x * p2.y - p1.y * p2.x;
}

bool is_intersect(P& p11, P& p12, P& p21, P& p22){
  return (cross(p12-p11, p21-p11) * cross(p12-p11, p22-p11) < 0)
	&& (cross(p22-p21, p11-p21) * cross(p22-p21, p12-p21) < 0); 
}

P calc_intersect(P& p11, P& p12, P& p21, P& p22){
  P d = p22 - p21;
  double t1 = abs(cross(d, p11-p21));
  double t2 = abs(cross(d, p12-p21));
  double t = t1 / (t1 + t2);
  P p1 = p12 - p11;
  p1.x *= t, p1.y *= t;
  P p = p11;
  p.x += p1.x, p.y += p1.y;
  return p;
}

int main(){
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  
  int N;
  while(cin>>N,N){
	int ans = 1;
	vector< pair<P,P> > ps(N);
	REP(i,N){
	  cin >> ps[i].first.x >> ps[i].first.y >> ps[i].second.x >> ps[i].second.y;
	  int cnt = 0;
	  set<P> intersects;
	  REP(j,i)
		if(is_intersect(ps[j].first, ps[j].second,
						ps[i].first, ps[i].second)){
		  P in = calc_intersect(ps[j].first, ps[j].second,
								ps[i].first, ps[i].second);
		  if(!intersects.count(in)){
			intersects.insert(in);
			++cnt;
		  }
		}

	  ans += cnt+1;
	}
	cout << ans << endl;
  }
  
  return 0;
}