You got to have friends, the song goes, and it’s not wrong. To a degree.

Friends do more for us than even our children and other relatives, Life Noggin says: They keep us alive for longer. According to the video, friends have a tremendous influence over us, as evidenced in part by one study in which lonely people were more likely to take huge risks while gambling. Having friends, on the other hand, stops us from making such risky decisions.

Read: The Health Benefits of Peer Pressure

Friends also encourage us to do the right thing, and that’s why some experts have advocated for doctors to leverage friendships — in addition to other social relationships — when trying to get their patients to make lifestyle changes, arguing that it is a case in which peer pressure would be beneficial.

That friendship leverage can be in the form of having someone taking heart medication in a public space rather than the bathroom, so there is a potential witness to noncompliance, or having a buddy to go to the gym with.

But make sure you don’t have too many friends — science and math have determined the ideal number, both for the people we are tightest with as well as those in our looser circle.

See also:

Friendship Benches Ease Anxiety and Depression

Mice Suffer When Their Friends Are in Pain