We show that for a finite algebra $\mathcal A$ there exists a function with values in natural numbers assigning to every element of $\mathcal A$ and every congruence of $\mathcal A$ with a given kernel a number of elements in the corresponding congruence class if and only if $\mathcal A$ is weakly regular. This is not true for infinite algebras.