MORE than a year after America and its allies set out to punish the Kremlin for backing rebels in Ukraine and annexing Crimea, Russia is finding new friends and dealing with the West from a position of growing strength. At any rate, that is the message that Vladimir Putin has been delivering to his own people and anybody else who will listen.

In his latest flexing of muscles, the president set out a naval doctrine on July 26th which aspires to challenge the Atlantic alliance in all its areas of operation, in reply to NATO’s “unacceptable” plans to move some forces close to Russia and expand its global reach. He wants an ocean-going navy, especially active in the Arctic and the Atlantic, to replace a fleet whose ageing ships mostly hug the coast.

This capped a month of diplomatic showmanship, in which the Russian city of Ufa, on the boundary between Europe and Asia, hosted summits of two organisations which aspire to challenge America’s global leadership. One is a mainly economic club known as the BRICS (including Brazil, India, China and South Africa); the other is the Shanghai Co-operation Organisation (SCO), focused on defence, which includes China and the ex-Soviet republics of Central Asia and has just gathered in both India and Pakistan.

As Russia’s state media told the story, the BRICS meeting was a new step in the construction of a counter-weight to the Western financial system; it established a $100 billion currency reserve fund which would emulate the IMF’s role as a stabiliser of monetary crises, and confirmed plans for a $100 billion development bank. The clear message was that, despite being excluded from Western capital markets, Russia has alternative economic partners.

In the tart words of Andrei Klimov, deputy head of the Federation Council’s foreign relations committee: “When a person turns his back on you, you have two choices—you can run after that person, or you can start to talk to other people.”

Meanwhile the sealing on July 14th of a nuclear deal between Iran and six world powers, led by America but including Russia, allowed the Kremlin to argue that the West still needs it. When Barack Obama thanked Mr Putin for his help with the accord, this seemed to boost the hope of some Russian officials that the West might give ground over Ukraine, or elsewhere in eastern Europe, because it craves Russian help in places like Iran or Syria.

In a quieter display of soft power, Mr Putin’s advocacy of “traditional values” got a fillip on July 3rd when, at the UN Human Rights Council, a motion lauding the conventional family was carried by a clear majority, led by Russia and Islamic states, against opposition from America and western Europe, which wanted a mention of new realities like gay partnerships. Alexei Pushkov, who chairs the Duma’s foreign-affairs committee, sees in the American Supreme Court ruling establishing gay marriage one more chance for Russian-led pushback. America will try and fail to propagate such unions, he says. But behind all the self-confident talk, over economics, defence or values, how well is Russia resisting Western pressure? In the cold light of day, Mr Putin’s rhetoric looks like a mixture of vain boasts and calculated realism (see article). Above all, China seems unlikely to meet Russia’s hopes, either as a provider of capital or as a security partner. Its economy towers over Russia’s and it does not share Mr Putin’s keenness to pick fights with the West. According to Angela Stent, a professor at America’s Georgetown University, most of the economic benefits from Sino-Russian co-operation are still far off. Talks on a pipeline taking Russian gas to China foundered this week. In China plans for an Asian Infrastructure Investment Bank, a development body that excludes America, takes priority over any BRICS project.

Nor is the SCO about to become a close-knit club comparable to NATO. Although China buys Russian weapons, the countries have their differences over security; for example, China resents Russia’s enduring ties with Vietnam. And Russia’s expansionism in Ukraine has made other neighbours, like Kazakhstan, more wary.

The Iran accord is also a mixed blessing for Russia. As Fyodor Lukyanov, editor of the journal Russia in Global Affairs, points out, Russia resisted economic sanctions against Iran (while going along with them in deference to its Western partners) so it should logically gain from their removal. But the deal could hurt Russia by lowering world oil prices and bringing new gas supplies to Europe; and under the letter of the deal, Russia will not be able to sell arms to Iran, as it badly wants to do, for at least five years. The real prize for Russia could come from unhappiness over the deal in Saudi Arabia, which is annoyed with America and looking for fresh financial partners.

Of all Russia’s initiatives, it is the naval expansion, part of a big drive to rearm that seems immune to budget cuts, that will be studied most in Western capitals. Russian yards have lost the capacity to build big surface ships, especially without access to parts from Ukraine. Its sole aircraft carrier is 30 years old and hardly seaworthy. It will be lucky if, as proposed, a new one can be launched towards 2030.

But Russia has always been able to make stealthy, deadly submarines, and it seems to have solved some problems with new types of conventional and nuclear-capable subs. Three of the latest sort of nuclear-armed boat are now plunging the ocean’s depths; seven more are planned. Although America’s navy, which soon aims to exceed 300 large ships, dwarfs all others, Russia’s naval effort is serious. The new doctrine implies eventually being able to confront NATO in every ocean where Western navies sail, albeit in ways short of war, says Peter Roberts, a research fellow at the Royal United Services Institute, a think-tank in London.

With its economy crimped—more than it admits—by Western sanctions, Russia’s best hope of fulfilling such a plan lies in persuading citizens to tighten their belts for the sake of a nation that supposedly faces a perpetual American peril. For Anna Glazova, of the Kremlin-linked Institute of Strategic Research, there is ample evidence of such a threat: proof positive is provided by the fact that Mr Obama once mentioned Russian misbehaviour, the Ebola virus and Islamic State terror all in the same speech.

For anyone who recalls Soviet times, this mix of defensiveness and defiance feels familiar. And in case proof were needed of Russia’s determination to say nyet, it vetoed, on July 29th, a UN security council resolution to create a tribunal to probe last year’s downing of a Malaysian airliner over rebel territory in Ukraine.