Donald Trump’s surprise victory in the US presidential elections sent Japan’s stock market into a temporary tailspin. It scared a populace well familiar with the Donald’s constant Japan-bashing and talk of America walking away from its military commitments unless Japan coughs up more yen. His candidacy also inspired some truly bizarre Japanese video art.

But there are reasons to think the two countries will remain BFFs, for at least the next several years.

One is that Japan’s prime minister Shinzo Abe—who will meet Trump in New York on Nov. 17—seems to have a light touch with geopolitical strongmen. Abe has spent much time and effort buddying up with Russian president Vladimir Putin, a head of state with whom Trump is much enthused.

Abe’s frequent visits to Moscow irked the Obama administration, which had been trying to isolate Russia after it invaded and annexed Crimea. But Abe is too eager to butter up Putin in hopes he will relinquish at least part of the contested Kuril Islands—known as the “northern territories” in Japan—which Russia took from Japan at the tail end of World War II. In recent months the two countries have moved closer to ending the 70-year-old dispute.

Japan has also proved a more steadfast investor in Russian energy projects than China, which Russia had hoped would become a major customer for its oil and gas.

Indeed, the Japanese PM reportedly has a good relationship not only with Turkey’s dictatorial president Recep Tayyip Erdogan, but also the leaders of Iran. He also hit it off with the Philippine president Rodrigo Duterte, telling the diminutive strongman he was “quite a famous figure” in Japan.

“Prime minister Abe has the mysterious skill of getting along with people,” Makoto Iokibe, political scientist and former president of the National Defense Academy of Japan, said in an interview with the Mainichi Shimbun. “If Abe can get along with Russian president Vladimir Putin, perhaps he won’t find it difficult to strike up a cordial relationship with Trump.”

Japanese defense could benefit

If nothing else, Trump’s rise has so far been good news for a business Abe has been trying without luck to promote: Japan’s nascent defense industry (pdf). Share prices for Mitsubishi Heavy Industries, Tokyo Keiki, and other companies that make military equipment shot up on Nov. 9 after the US election results became clear. Tokyo Keiki shares remain nearly 20% higher than they were the day before the election.

Investors think that Japan and other East Asian countries will have to develop their own militaries further if the US walks away. And Japan’s shrinking population suggests that a military expansion will be more about technology than combat boots.

But some in Japan don’t think it will come to that. Tokyo may be able to cut through any bluster coming from the Trump camp by showing that the US is benefiting at least as much as Japan by having its longtime ally play host to its military.

Trump might only be looking at the $1.8 billion top line of what Japan pays directly to the US government for defense support, says Garren Mulloy, an associate professor in international relations at Daito Bunka University in Japan. But the real budget is closer to $3.7 billion, when all the indirect payments Japan makes to the US military are considered.

Those perks include paying for the rent on the land the US military occupies, and for the wages earned by local workers employed on the bases. Japan is also committed to footing part of the bill for the US military to move a base from Okinawa to Guam. One estimate shows that with all indirect payments included, Tokyo pays for about 75% of the bill for the US presence in the country, higher than any other ally with a similar arrangement.

By simply rearranging some accounting, Mulloy said, Japan could more than double its top-line payments to the US government.

“What Donald Trump doesn’t quite grasp is that while Japan gets a great deal for the defense it receives, the deal also works very well for the Americans,” Mulloy said. “Their force is getting subsidized. Japan could say we’re increasing payments from $1.8 billion to $4 billion overnight. Trump would look at it and be thrilled.”

You can follow Ben on Twitter at @bjlefebvre.