This story originally aired in January of 2016. The next affordable housing lottery in San Francisco will take place on January 18, 2018. It’s for 28 units in the Alice Griffith Apartments. There's an information session for Wednesday, December 13. For more information, click here.

About a hundred people are seated in the basement auditorium at the San Francisco Main Library, waiting for an affordable housing lottery to begin.

Up on the stage, Brooke Barber from the Mayor’s Office of Housing and Community Development stands behind a clear plastic box with a handle on it, kind of like what you’d use to play bingo.

The box is full of white slips of paper with numbers printed on them. There are about 2,500 slips — each representing a person trying to find an affordable place to live in San Francisco.

According to federal standards, an individual shouldn’t spend more than 30 percent of his or her income on housing. A 2015 report by the real estate database Zillow found that most renters in San Francisco spend about half their paycheck on rent.

Ninety-one affordable units are up for grabs today — a mix of studios and one- and two-bedrooms. They’re part of the city’s BMR, or below-market rent program, where for-profit developers set aside some lower-rent units in an otherwise market-rate building. To qualify for one of these apartments, an applicant can make up to 55 percent of San Francisco’s Area Median Income — $37,350 for an individual.

They also have to pass a credit check and have a clean housing record — no evictions for cause in the past seven years. And then, certain people get their numbers thrown in the box first.

The first order of preference goes to people displaced from Western Addition or Bayview-Hunters Point in the '60s and '70s, when almost 6,000 people were forced to leave their homes for redevelopment. Some of them are still looking for an affordable place to live.

“We have 10 folks who applied to that preference,” Barber says from the stage.

The next order of preference is for people evicted under the Ellis Act. And the last preference goes to people who already live or work in San Francisco. There are so many of those tickets, Barber has to regulate how much she turns the box.

“So I’m not gonna turn this every two to three tickets that I pull. I will turn them at least once every ten tickets and then I will turn the box,” she says.

And then, with little ceremony, the lottery begins.

Barber calls the first number: 6960458.

A lone woman toward the back of the room — Niambi Campbell — cheers and claps. Some people turn around in their seats and flash a quick smile. Campbell hops up and runs out into the hallway to make a phone call to her mom.

Campbell’s parents were part of that group displaced from Hunters Point. They ended up finding a new house, where she’s been living, but the lottery’s special preference program also applies to children of the displaced. So now Campbell can move into her own place in San Francisco.

“So this is home and it's where I need to be,” Campbell says. “Jobs, schools – this is where I should be.”

Back in the auditorium, the lottery proceeds at a hypnotic pace. A woman pats a fussy baby on the back. A man takes his toddler daughter for a walk up and down the aisle. People shift in their seats. And yet, each seven-digit number wields tremendous power.

Even though there are only 91 apartments available, they’ll call a thousand numbers today. That’s in case people at the top of the list don’t actually qualify for some reason. So, even though Shawanna Smith gets picked 107th, she still feels pretty good.

“I'm extremely happy right now,” Smith says.

Smith is here with her baby girl. Right now they’re both living with Smith’s fiancee in Fairfield, almost 50 miles from his job in San Francisco. They’ve been trying to move to the city.

“It’s really out of our price range,” Smith says. “A studio right now is like $1,300 and we don't have $1,300 to spend on rent.”

A studio in the lottery building goes for $941 per month.

As the lottery creeps further into the hundreds, Shawanna Smith seems like the last person in a good mood.

Ty Edwards paces the back of the auditorium, rustling a brochure about the apartment building between his fingers.

“I've been trying for three years now and this is the first time they've had a lottery of this size,” he whispers. “So I'm just hoping that my number gets called this time.”

Edwards stays in a homeless shelter in San Francisco. He used to work for the city, but got laid off.

“I’m just a veteran that's down on his luck, that's all,” Edwards says.

Nearby, Gloria Mendoza is losing her patience. She had to step out and now she doesn’t know if her number’s been called.

“The guy right here in the front said that they don't go backwards on the numbers, so I'm not sure,” she explains. “I had to go move my daughter’s car so I'm still like, backed up now.”

Mendoza says she often sleeps in that car. Or at her daughter’s studio in the Tenderloin, but she’s only allowed nine overnight guests per month. Mendoza lost her Section 8 apartment in September. Her landlord decided to stop accepting vouchers for the federal subsidized rent program — it’s voluntary.

“She didn’t want to participate in the program anymore. She was a very very nice landlady,” Mendoza says. “And I've never had an issue with like, paying rent or anything. It's just what happened to me. It could happen to anyone.”

Mendoza can keep looking for landlords that will accept her voucher. In that way, she’s lucky. The waitlist for Section 8 is closed. So is the one for San Francisco public housing — a separate federally-funded program for low-income families. There’s just too much demand and not enough supply.

And you could say the same thing for all housing in San Francisco. Last year about 370 affordable units came available through the lottery program. That’s not even enough to house all the people who applied for today’s lottery.

Mayor Ed Lee has pledged to create or rehabilitate a total of 30 thousand new housing units — with a third of those designated affordable, by the year 2020. But for those who won’t end up a winner in the lottery, that’s not nearly soon enough.