Calculating the number of items in inverse variation