Finding the number of objects