STOCKTON - Stockton's homeless men, women and children filed in by the dozen into St. Mary's Dining Room for breakfast Friday morning.

While some had spent the night in shelters, others had slept under bridges around downtown or made camp in a row of crude lean-tos erected along a fence across Sonora Street from the dining room.

Friday was different, though. It was the third day of a three-day census of the homeless population in San Joaquin County.

So there were more groups offering help and services on Friday than on a typical day at St. Mary's to draw as many of the homeless population who are living on the streets or in their cars and are the hardest to reach to count.

It's difficult for some to live under the rules and structure in a shelter, said Michael Donis, 60. But it's worth it for the Stockton native, saying that waiting a few more hours before you're allowed to smoke a cigarette is better than trying to find a safe place to sleep outdoors, where you can be beaten or robbed, he said. "You just never know. You just never know what's going to happen."

Stockton's gathering was the fourth in three days, following similar events in Lodi, Tracy and Manteca. It happens every two years, part of a point-in-time count of the nation's homeless population.

Each local event had volunteers with clipboards filling out a survey that started with the question: "Where did you spend last night?"

It will take awhile to collect the surveys from all the events and put them together with numbers from all the homeless shelters and other groups providing care for the homeless, said Bill Mendelson, director of Central Valley Low Income Housing and one of the organizers. But initial estimates look like the county number will be similar to two years ago, he said.

The counts are important in a number of ways, both large and small, said Chris Becerra, management analyst for the county Community Development Department.

For one, it helps identify the needs of the people who are homeless. But most significant, the counting is necessary to receive the funding that pays for much of what is available to help the population. "It just helps us keep our existing federal funding."

Earlier this month, the San Joaquin County Board of Supervisors approved applications for up to about $5.3 million in federal grants for programs at Lutheran Social Services, new Directions and Central Valley Low Income Housing Corporation, which is the requesting about $4.6 million to continue existing services and housing from more than 450 homeless people in the county.

Required by the U.S. Department of Housing and Urban Development, similar counts are occurring across the country.

There are more homeless men than homeless women. There were 606 homeless children counted, or about 22 percent of the homeless population.

In 2011, children made up 37 of the 347 "unsheltered" homeless counted. This is the segment of the homeless population living in cars, on the streets or in makeshift campsites. More than half of the county's unsheltered homeless were found in Stockton.

This population is the toughest to count.

Which is why organizers offer a cluster of services and giveaways that will bring the homeless to them, though they admit it won't likely catch everybody.

New this year were workers from the Department of Motor Vehicles to give out identification cards, something that can make life a lot easier for people trying to hook up with services. On Friday alone, the DMV handed out 80 cards, organizers said.

And there was access to health care available at the events through CARE LINK for those who didn't use the Community Medical Centers' homeless program clinic at Gleason House in south Stockton.

Homelessness itself exacerbates medical issues, from having a cold to dealing with infection to suffering chronic illness, said Randy Pinnelli, CARE LINK program coordinator. "The majority of the problems we see are made worse through lack of housing."

While volunteers, government workers and nonprofit staffers bustled inside St. Mary's on Friday morning, Rosalio Puentes cleaned up one of the shelters along the fence across the street. The 72-year-old Puentes had been sleeping in one of the makeshift shelters, and he said he was being paid by a local business to clean up some of the mess left by the people living along the fence.

But those days were about to end.

Police told them they were planning to clear out the encampment this morning. It's a routine occurrence that happens whenever the encampment appears, grows and neighbors start reporting problems.

Puentes said he would move across the street to the Stockton Shelter for the Homeless to sleep tonight.