For each $n\times n$ matrix $A$ with real entries the set $$C(A)=\{X\in M_n(\mathbb{R}): AX=XA\}$$ is obviously a linear subspace of $M_n(\mathbb{R})$.

Can we recognize the dimension of this space by looking only at the Jordan form of $A$?

We know that this dimension is at least the degree of the minimal polynomial of $A$, but this bound is not sharp, since for example for the identity matrix the degree of the minimal polynomial is 1 and $\dim C(I)=n^2$.