Degrees of freedom calculator