$189M in the city's budget goes directly to homeless services. That's roughly $25k per homeless person in direct spending. The city estimates it spends another $20k per homeless person in indirect city services (health, police, fire). The "frequent fliers" cost the city more than $100k per year.
In many ways, $40k per person is a low-end figure.