It's a lesson everyone from a Mafia member to an Ivy-League applicant knows only too well: It pays to be connected.

And it's something that countries striving to improve the lot of their citizens should pay heed to as well. So says the research arm of McKinsey & Co. in a 144-page report.

The global consultants found that the more tied-in a country is to the rest of the world, the better its economy fares. Being connected doesn't stop at trade and finances. It’s also about people -- primarily the number of immigrants a nation has -- and the amount of data streaming across a country's borders.

Putting it all together, the McKinsey Global Institute ranked 139 countries by how linked they are to the rest of the world. At the top is the tiny island state of Singapore, which has successfully made itself into a regional center in Asia, and the Netherlands, one of Europe's main digital hubs.

The U.S. comes in third, followed by Germany. China ranks seventh.

At the bottom is another island nation, Seychelles, and Sierra Leone. Japan, the world's third-largest economy with a host of global brands, comes in surprisingly low, at No. 24, mainly due to its limits on immigration.

The report reckons that the world economy as a whole benefited to the tune of about $7.8 trillion in 2014 from the flow of goods, services, finance and data across borders.

"Countries that are open to global flows increase their GDP," or gross domestic product, said Susan Lund, a partner at the institute who is located in Washington.

McKinsey also argues that reports of the death of globalization are premature. Yes, world trade growth has slowed markedly. And global capital flows have collapsed, after peaking at close to $12 trillion in 2007 before the onset of the financial crisis.

Yet the baton has been taken up by an explosion in the transmission of data around the world. Half of Facebook Inc.'s users had at least one international friend in 2015, up from just 16 percent in 2012.