How to count your herd