If v is provided, the number of cases associated with v, otherwise the total number of cases in the DQM.