How is the total number of pets calculated?