Wow. Got lots of downvotes on the above comment. Not complaining, but curious what is going on here.
It is not at all clear that "most homeless people have mental problems" because it is not at all clear how many people are homeless. There are many people who are couch surfing around friends places with no actual home of their own. They are homeless, but they don't necessarily count amongst the homeless figures. They are also completely mentally competent. They may also outnumber the official homeless, but we don't really know.