Crossed lines

Problem 630

Given a set, , of unique lines, let be the number of lines in the set and let be the sum over every line of the number of times that line is crossed by another line in the set. For example, two sets of three lines are shown below:
crossed lines
In both cases M(L) is 3 and S(L) is 6: each of the three lines is crossed by two other lines. Note that even if the lines cross at a single point, all of the separate crossings of lines are counted.
Consider points (, ), for integer , generated in the following way:



For example, the first three points are: (527, 144), (−488, 732), (−454, −947). Given the first points generated in this manner, let be the set of unique lines that can be formed by joining each point with every other point, the lines being extended indefinitely in both directions. We can then define and as described above.
For example, and . Also and .
Find .