Count the number of matched messages