function to count number of comorbidities in a data frame with one row per patient and 0/1 flags in each comorbidity column