# Matrices in equivalence classes - how to count degrees of freedom?

A complex $n \times n$ matrix has $2n^2$ real degrees of freedom.

Now suppose I group all the matrices into equivalence classes, where the matrices that are in one class are unitarily similar by some diagonal unitary matrix.

So I want to pick one of the equivalence classes... how many degrees of freedom do I have?

My guess is there are $2n^2 - n$ real degrees of freedom, where the $-n$ comes from the n real phase angles of the unitary diagonal matrix. But I don't really understand this.

What is the proper way to do this?