Answer:
It is difficult to give a specific answer without your scenario but maybe this may help you out a bit.
Let's say you have a line like the one attached:
I labelled certain points b and u so you can use it as a reference. Now all you need to do is count all the points that lie on the same line and are found between.
In this case it would be point d and point e because the rest of the points do not line on the same line. For this problem particular scenario, the answer would be 2.