A pet shelter holds forty dogs and cats. The average age of the dogs is 16.66 months and the average age of the cats is 18.75 months. The average age of all the animals combined is 17.5 months. The difference between the number of dogs and cats is eight. How many cats live in the shelter?
(A) 12
(B) 16
(C) 18
(D) 20
(E) 24