count the number of md