On the number of matrices with given characteristic polynomial