9. On a rotating round table, there are 8 white teacups and 7 black teacups, and around the table sit 15 dwarfs, each wearing a hat, with 8 white hats and 7 black hats. Each dwarf places a teacup of the same color as their hat in front of them. After the table rotates randomly, what is the maximum number of teacups that can be guaranteed to match the color of the hats (the dwarfs can choose their seating, but they do not know how the table will rotate)?
9.7.

First, observe any arrangement of the teacups and write their colors in a row. Below this row of colors, write down all its different cyclic shifts, a total of 14. Then count how many times the colors match at the same position in the initial arrangement and during the shifts. For each black teacup, there are 6 shifts where the color matches, and for each white teacup, there are 7 shifts. Therefore, for a total of 14 shifts, there are $7 \times 6 + 8 \times 7 = 98$ color matches. This indicates that there exists a shift where the number of color matches is no more than $\frac{98}{14} = 7$.
Finally, observe the color distribution:
white white white white black white black white white black white black black black.

It can be directly verified that, in the 14 cyclic shifts of this arrangement, there are exactly seven color matches in each shift.