A study of Barbary macaques living through a harsh winter in the mountains of Morocco suggests that monkeys with more friends were more likely to survive in extreme environmental conditions.

Endangered Barbary macaques are accustomed to cold, but during an unusually cold winter in 2008-2009 snow covered the ground for nearly three months longer than normal, causing the monkeys, which eat seeds and grasses on the ground, to starve.

While conducting research as part of a wider project on the Barbary macaques' social life, Richard McFarland, a behavioral ecologist at the University of the Witwatersrand in Johannesburg, South Africa, found numerous Barbary macaque corpses in January 2009, according to a report by Nature.

McFarland and his team began studying two troops of the monkeys in January 2008. A year later, only 17 of the 47 adults were still alive -- a mortality rate of 64 percent.

The researchers believe the survival rate of the monkeys was dependent on the number of social contacts they had, and after an analysis of the monkeys' social data from the previous year, they determined that the more friends a monkey had, the more likely it was to have survived the cold winter.

"Previous studies investigating the link between sociality and fitness have mainly focused on the long-term reproductive benefits afforded by maintaining strong and stable social relationships," McFarland said in a press statement. "However, our findings indicate that the effect of sociality on fitness is so strong that it can predict survival in the short-term, across an unpredictable environmental event."

Individuals with whom a monkey had exchanged grooming or had bodily contact with at least once during previous observation sessions were considered a social relationship or "friend" by the researchers.

Such a thin definition of friendship also led the researchers to suggest that it was the quantity of friends, rather than the quality of the friendships, that enabled the monkeys to survive.

Study co-author Bonaventura Majolo, from the School of Psychology at the University of Lincoln, said the macaques' survival may be "due to the increased feeding tolerance resulting from a larger network of social relationships reducing the amount of time and energy expended in foraging."

"Our results also suggest that monkeys with a greater number of social relationships may also have better access to huddling partners at night and in cold periods," Majolo said.

The research is published in the latest issue of journal Biology Letters.