How to calculate degrees of freedom in a Chi-Squared Test? [closed]

I'm looking to calculate the degrees of freedom (df) for a chi squared test which has one dependent group with 3 categories and one dependent group with 4 categories. What would the df be?

When the data are in a contingency table, the formula to use is $$df = (r-1)(c-1)$$ where $$r$$ is the number of rows and $$c$$ is the number of columns. So in this particular case the answer will be 6.