Turns out that the optimal solution has been known since 1991. The answer is we need
gloves to have $n$ doctors operating on $n$ patients without the risk of infecting each other. This number is optimal.
Ilan Vardi published it in chapter 10 of Computational Recreations in Mathematica (Addison-Wesley). Both the proof ...