ncomp function

Get the number of components