# Degrees of freedom

How is for rigid body made up of n particle, the degree of freedom is 3n-nC2.i can understand that degree freedom of n particle is 3n and suppose you have 2 particle whose distance between them is fixed, then degree of freedom is n 3(2)-1=5.if we have three particles then it is 7.
Therefore n particle whose distance between them is fixed have degree of freedom which is 3n-(n-1) .how can it be 3n-.nC2.