Simple Problem

0

0 votes
Medium
Problem

The problem is simple (Well, simple to understand at the least).

You are given n lines of the form ax+by+c=0. Moreover, no 3 lines pass through the same point. You have to find the number of triangles that can be formed using these lines.

Input

First line of input contains N - number of lines. N lines follow, each line contains three integers a, b and c corresponding to the formula of ith line. Moreover, a and b will not be simultaneously 0 for a line.

Output

Output a single integer corresponding to the number of triangles formed by these n lines.

Constraints

1<=N<=300000

|a|,|b|,|c|<=109

Setter : Karan Thakkar

Sample Input
6
0 1 0
-5 3 0
-5 -2 25
0 1 -3
0 1 -2
-4 -5 29
Sample Output
10
Time Limit: 1
Memory Limit: 256
Source Limit:
Editor Image

?