-- Anne Bakstad and Ed Cohen are starting to feel as if their family of four is an endangered species in San Francisco.

Since the couple bought a house five years ago, more than a dozen families in their social circle have left the city for cheaper housing, better schools or both.

The goodbyes are so frequent that Carina, age 41/2, wants to know when she is going to move, too. Eric, 21/2, misses Gus, his playmate from across the street.

"When we get to know people through our kids, we think to ourselves, 'Are they renters or owners? Where do they work?' You have to figure out how much time to invest in people," Bakstad said. "It makes you feel like, 'Where is everyone going? Stay with us!' "

A similar lament is being heard in San Francisco's half-empty classrooms, in parks where parents are losing ground to dog owners and in the corridors of City Hall.

San Francisco has the smallest share of small fry of any major U.S. city. Just 14.5 percent of the city's population is 18 and younger.

It is no mystery why U.S. cities are losing children. The promise of safer streets, better schools and more space has drawn young families away from cities for as long as America has had suburbs.

But kids are even more scarce in San Francisco than in expensive New York (24 percent) or in retirement havens such as Florida's Palm Beach (19 percent), according to Census Bureau estimates.

San Francisco's large gay population -- estimated at 20 percent by the city Public Health Department -- is thought to be one factor, though gay men and lesbians in the city are increasingly raising families.

Another reason San Francisco's children are disappearing: Family housing in the city is especially scarce and expensive. A two-bedroom, 1,000-square-foot starter home is considered a bargain at $760,000.

A recent survey by the city controller found 40 percent of parents said they were considering pulling up stakes within the next year.

Determined to change things, Mayor Gavin Newsom has put the kid crisis near the top of his agenda, appointing a 27-member policy council to develop plans for keeping families in the city.

"It goes to the heart and soul of what I think a city is about -- it's about generations, it's about renewal and it's about aspirations," said Newsom, 37. "To me, that's what children represent and that's what families represent, and we just can't sit back idly and let it go away."

Newsom has expanded health insurance for the poor to cover more people younger than 25 and created a tax credit for working families. And voters have approved measures to patch up San Francisco's public schools, which have seen enrollment drop from about 62,000 to 59,000 since 2000.

One voter initiative approved as much as $60 million annually to restore public school arts, physical education and other extras that state spending no longer covers. Another expanded the city's Children's Fund, guaranteeing about $30 million a year for after-school activities, child care subsidies and other programs.

"We are at a crossroads here," said NTanya Lee, executive director of the nonprofit Coleman Advocates for Children and Youth. "We are moving toward a place where we could have an infrastructure of children's services and no children."

Other cities are trying similar strategies. Seattle has created a children's fund like the one in San Francisco. Leaders in Portland, Ore., are pushing developers to build affordable housing for families, a move Newsom has also tried.

For families choosing to stay in San Francisco, life remains a series of trade-offs. They can enjoy world-class museums, natural beauty and an energy they say they cannot find in the suburbs.

But most families need two or more incomes to keep their homes, and their children spend most of their days being cared for by others.

"We have so many friends who are moving out and say how much easier life has been for them," Bakstad said. "If we can make it work in the city, we would love to stay. In a way, the jury is out."

Students play in the schoolyard during recess at de Avila Elementary. With low enrollment an issue, the school will be closing at the end of this school year.Teacher David Morales reads to his first-grade class, which has nine students, at William R. de Avila Elementary School in San Francisco. San Francisco has the smallest share of children of any major U.S. city.