Three days after the shock waves of the first earthquake rolled through here, buckling pavements and sending ceiling lamps wheeling in frantic circles, Mexico's dazed residents finally have had time to survey their situation and take stock of what has been saved, along with the losses.

Perhaps most important is the realization that the major part of the city survived intact. Devastating damage was wrought on a few populous neighborhoods, but the quake struck with almost finicky precision. While about half of the tourist area known as the Zona Rosa was shut down, waterless and dark, on the other side of Niza Street, which runs through it, restaurants and boutiques were open for business.

The southern portion of the city, which is generally greener, less populated and the favored place of residence of artists and intellectuals, was unscathed. The owner of the Delfos, a trendy restaurant in the colonial section of Coyoacan, reported that his place had remained open throughout and was doing its usual brisk business.

The historic area of downtown, known for its magnificent 16th and 17th century palaces and convents, survived with relatively little damage, even though it lies in the heart of the hardest hit area. Once again the architects of those massive monuments to the power of Spanish empire proved their worth.

The newspaper Excelsior today quoted the watchman at the renowned Iturbide Palace, now headquarters for a bank, as saying: "Not even a pen rolled off the desks here." It was as if nature were mocking the succession of building booms and the lack of urban planning that have steamrollered through the city's modern history.

In the midst of the week's turmoil, Mexicans discovered something else long missing in their quest for modern living -- an ability to help one another.

City residents living under the continuous strain of severe overcrowding have developed a "me-first" approach to everything from elbowing onto packed metro trains to bribing city officials for permission to build on land designated as "urban green space."

The earthquake put a temporary halt to all that.

"I was beginning to lose faith even in our character," said Gonzalo Ceja, an artist. "But watching people cooperate, seeing how young kids volunteer for the rescue brigades, how even children manage to direct traffic so efficiently has been like a balm."

Isolated incidents of looting and fighting for scarce water supplies have been reported, but under the circumstances they seemed to be remarkably limited.

While the major earthquakes that struck twice in less than 48 hours last week were catastrophic, they only added to the urban nightmare of a long-suffering city, which together with its suburbs harbors a population of more than 17 million.

According to Mayor Ramon Aguirre Beltran's preliminary report on the quake damage, about 800 residential and office buildings were destroyed or were so badly damaged that they must be demolished. Most are in overcrowded downtown working-class neighborhoods, and the rubble and longer term disruption of rebuilding will simply add to those areas' squalid living conditions.

Reconstructing the disrupted water and sewage systems will further strain neighborhoods where water is regularly hoarded against almost daily dry spells. Spokesmen for the Department of the Federal District -- the equivalent of city hall -- said that many of the water mains in the affected areas dated from colonial times and are not charted. Simply finding the network will be a slow and costly operation.

Just as most of the buildings that collapsed during the earthquake were the most modern, so, too, was the country's long-distance telephone service, one of the first casualties of the initial tremor. Yesterday, officials from the national phone company union said that reestablishing the service will take at least two months. Both long-distance phone centrals were in downtown buildings, and the equipment was irreparably damaged.

The loss of Mexico's largest hospital complex, the Centro Medico, which provided advanced and free health care for thousands of people, may turn out to be an even greater long-term catastrophe than the thousands of deaths that came almost instantaneously in the quake.

The center virtually was destroyed, and for a government squeezed into a tight financial corner by a $96 billion foreign debt, rebuilding it and restoring public services will drain funds that might have been used to deal with the city's chronic and critical problems.

There is a Mexican saying to the effect that a fallen man generally gets kicked. It was on the mind of a planning official who mentioned yesterday that one of the government buildings hit by the quake collapsed on top of the computer where much of next year's budget was being processed.

"This country never gives us a break," he muttered bitterly. But like so many of his fellow residents, he was planning to report for work Monday to start all over again.