Number of objects before the first object = a
Number of objects between the first and second object = b
Number of objects between the second and the third object = c
Number of objects after the third object = d
a + b + c + d = (N - 3)
Here b and d should be > 0 whereas a and d can be 0
Let's put b = b' + 1 and c = c' + 1
By doing this we can say that b' and c' can be 0
=> a + b' + 1 + c' + 1 + d = (N - 3)
=> a + b' + c' + d = (N - 5)
Number of solutions to the above equation
= (N - 5 + 4 - 1) C (4 - 1)
=(N - 2) C 3