Add declarations for count helper functions