Count number of features in sparse matrices.