Roughly 28,200 people were homeless in 2017, according to a new report released Tuesday on the state of homelessness in the Bay Area.

The Bay Area Council Economic Institute's report found that the homeless population in the Bay Area's nine counties is third behind Los Angeles (55,200) and New York City (76,500). It would take $12.7 billion to create housing for everyone, the report says.

Analyzing data from the U.S. Department of Housing and Urban Development, as well as interviews with experts from Alameda, Contra Costa, Marin, Napa, San Francisco, San Mateo, Santa Clara, Solano, and Sonoma counties, the study says the Bay Area will not be able to provide a bed to each of its homeless residents until 2037.

"The absolute size of the Bay Area’s homeless population, combined with the region’s dearth of temporary shelter options and an insufficient supply of supportive housing, desensitizes the public and condemns the homeless to lives of hardship," the report read.

The report highlighted the real cause of homelessness: housing supply and affordability.

Every county in the Bay Area has added fewer affordable housing units than needed, with permits issued satisfying roughly 1/3 of need, the report said. And roughly 2/3 of extremely low income households, those earning less than 30% of the area median income, are spending more than 50% of their incomes on rent.

The report also pointed out insufficient public resources for psychiatric care.

What can counties do better? The Economic Institute says preventing individuals from becoming homeless is a cost effective way to keep the crisis from growing.

Officials must also provide accommodation to the unsheltered homeless residents and maximize the number of units and housing programs dedicated to homeless individuals and families to provide long-term solutions, the report says.