Fix signature of function that returns the count
Add function to estimate min count