Degree of freedom calculator