In a chi-square test for goodness of fit if there are 8 classes and if two parameters are’ estimated, that is the degrees of freedom of the test statistic.
(n – 1 – 2) = (n – 3)d.f.