How many triangles? How many triangles are there in the following figure?

... ding! Time’s up. The answer is 29. Given at most 10 line segments, you are to write a program that counts the number of triangles bounded by them. Note that three colinear points do not make a triangle. Input Input consists of several test cases. Each case begins with a line containing an integer N (3 ≤ N ≤ 10). The following N lines each gives four integers, x1, y1, x2 and y2, meaning that you draw a straight line segment from (x1,y1) to (x2,y2). All the coordinates given have their absolute values no greater than 100. Input is terminated by EOF. Output For each case, output the number of triangles bounded by the N lines. Sample Input 10 -5 4 5 -4

10979 – How many triangles? 2/2 -5 4 -6 -1 -5 -3 -1 4 -5 -3 5 3 -5 -3 7 0 -1 4 6 -2 0 0 6 -2 6 -2 5 3 7 0 5 -4 -6 -1 3 -1 Sample Output 29