Number of domains in the matrix