#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for (ll i=(a);i<(b);i++)
#define RFOR(i,a,b) for (ll i=(b)-1;i>=(a);i--)
#define REP(i,n) for (ll i=0;i<(n);i++)
#define RREP(i,n) for (ll i=(n)-1;i>=0;i--)
#define debug(x) cout<<#x<<": "<<x<<endl
#define pb push_back
#define ALL(a) (a).begin(),(a).end()

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
	EACH(x,vec) is >> x;
	return is;
}
template<typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
	REP(i,vec.size()) {
		if (i) os << " ";
		os << vec[i];
	}
	return os;
}
template<typename T>
ostream& operator<<(ostream& os, vector< vector<T> >& vec) {
	REP(i,vec.size()) {
		if (i) os << endl;
		os << vec[i];
	}
	return os;
}

typedef complex<ld> Point;
namespace std {
	bool operator<(const Point &lhs, const Point &rhs) {
		if (lhs.real() < rhs.real() - eps) return true;
		if (lhs.real() > rhs.real() + eps) return false;
		return lhs.imag() < rhs.imag();
	}
}

class Line {
public:
	Point a, b;
	Line () : a(Point(0, 0)), b(Point(0, 0)) {}
	Line (Point a, Point b) : a(a), b(b) {}
};
ld cross(Point a, Point b) {
	return imag(conj(a) * b);
}
Point is_ll (Line s, Line t) {
	Point sv = s.b - s.a, tv = t.b - t.a;
	assert(cross(sv, tv) != 0);
	return s.a + sv * cross(tv, t.a - s.a) / cross(tv, sv);
}
bool isis_sp (Line s, Point p) {
	return (abs(s.a - p) + abs(s.b - p) - abs(s.b - s.a) < eps);
}


int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	int N;
	while (cin >> N, N) {
		vector<Line> l;
		REP(i,N) {
			int x1, y1, x2, y2; cin >> x1 >> y1 >> x2 >> y2;
			l.pb({Point(x1, y1), Point(x2, y2)});
		}
		int ans = 1;
		REP(i,N) {
			set<Point> s;
			REP(j,i) {
				if (abs( cross(l[i].b-l[i].a, l[j].b-l[j].a) ) < eps) continue;
				Point p = is_ll(l[i], l[j]);
				if (p == l[i].a || p == l[i].b || p == l[j].a || p == l[j].b) continue;
				if (isis_sp(l[i], p) && isis_sp(l[j], p)) {
					s.insert(p);
				}
			}
			ans += s.size()+1;
		}
		cout << ans << endl;
	}
}