Finding the greatest number of items that can be equally divided