Outsports lists 21 openly gay athletes. 3 of them are men, 18 are women.
Huffington Post article has a slideshow with their pictures:
There are 10,500 athletes competing. So even if we used the most conservative estimate, which puts the number of gay people in the general population at 4%, we end up with 420. Which shows there's still a very long way to go.
Matthew Mitcham's (Australian Diver and 2008 Olympic Champion) story shows why so few athletes decide to come out, even if they come from nations where homosexuality is accepted for the most part.
Despite winning the gold medal in great style, being hunky and handsome, Mitcham got zero endorsements following his victory.
A straight guy in his position would surely attract loads of sponsorship deals.
But he only got one endorsement from Telstra (a telecom company) a year after the games and then in the following year another from a swimsuit company. And that's it.
So yeah, it pays off to remain in the closet.