The question does not ask that .But i told a general principle.For example a simple pendulum which is oscillating in a plane.since its moving along the arc of a circle(distance from orgin is fixed) it has only one degree of freedom...theta...which is the angle dat the string makes with...
A square is composed of many particles with the constraint that distance between every particle is the fixed.so such a square is moving in XY plane.
if i consider two particles they have 4-1 =3degree of freedom(one is subtracted due to constraint that distance between particles are fixed).if...