- Time limit: 2.00 s
- Memory limit: 512 MB
Given horizontal and vertical lines, your task is to calculate the number of their intersection points.
You can assume that the lines are all distinct.
Input
The first input line has an integer : the number of lines.
Then there are lines describing the lines. Each line has four integers: , , and : a line that pass through the points and .
Output
Print the number of intersection points.
Constraints
Example
Input:
3 2 3 7 3 3 1 3 5 6 2 6 6
Output:
2