The answer is 22.
Howie needs 2 white socks and 2 black socks. So let's say he was very unlucky. He takes out all his Halloween socks(8), then he takes out all his white socks(12), and then he needs 2 black socks.
so the answer is 8+12+2=22
If you did it the other way around it would be 8+9+2=17
--Harry