There are 40 gloves in a drawer: 10 pair of white gloves, 5 pairs of black gloves, 3 pairs of brown, and 2 pairs of gray. You select the gloves in the dark and can check them only after a selection has been made. What is the smallest number of gloves you need to select to guarantee at least one matching pair?