require 'mathn'
require 'matrix'
require 'set'

loop {
	n = gets.to_i
	break if n == 0
	cross_point = Hash.new(0)
	lines = []
	count = 1

	n.times {
		l = gets.split.map &:to_i
		x1, y1, x2, y2 = l
		crossed = Set.new
		count += 1
		lines.each{|u1, v1, u2, v2|
			mat = Matrix[[y2-y1, x1-x2], [v2-v1, u1-u2]]
			vec = Vector[x1*(y2-y1)-y1*(x2-x1), u1*(v2-v1)-v1*(u2-u1)]
			if !mat.singular?
				cp = mat.inv * vec
				next if cp[0].abs >= 100 || cp[1].abs >= 100
				crossed << cp
				count += 1
			end
		}

		crossed.each{|cp|
			count -= cross_point[cp]
			cross_point[cp] += 1
		}
			
		lines << l
	}
	p count
}