command | count

This will return the number of occurrences