Congress is unlikely to override a promised veto by President Obama if both chambers reject a deal to curtail Iran’s nuclear capabilities, according to a Washington Post analysis of where the votes currently stand.

But several things have to happen first.

When both chambers return from the August recess, all 246 House Republicans are expected to vote against the deal, the analysis found. So far, 12 House Democrats have declared they too are opposed — more than enough to pass a resolution of disapproval through the lower chamber.

[Iran deal ads running in at least 23 states]

Over in the Senate, the vote to pass a resolution of disapproval is closer. About 31 Democrats either support the deal or are expected to back it, while 56 senators — including all Republicans plus two Democrats (Sens. Chuck Schumer (N.Y.) and Bob Menendez (N.J.)) — are either overtly against the pact or presumed foes. But as of now, that’s not sufficient to clear the 60-vote hurdle needed to pass the disapproval resolution.

If Congress rejects the deal at first pass, Obama has pledged to veto the resolution, meaning that opponents would then need to corral a two-thirds majority of both chambers to override the president and kill the deal.

But our analysis found that it will be very difficult for the deal’s opponents to override the president’s veto. In the House, rivals of the deal would need 44 of the remaining undecided Democrats to break with Obama, while in the Senate, 10 of 12 Democrats who are still undecided or haven’t tipped their hands would have to defy Obama to overturn the deal.

Given the full-court press from the White House and the fierce lobbying campaign currently afoot, that is a tall order — in the Senate especially.

The Given: The House

The House’s GOP leaders don’t have a terribly hard sell when it comes to rallying their ranks against the deal. Within hours of the deal’s release, many rank-and-file Republicans had already loaded up their quiver of political epithets to take aim at the agreement, and they have kept up the fiery fusillade for the last several weeks.

Leaders have predicted that the deal will “fuel a nuclear arms race” — that from House Speaker John Boehner (R-Ohio) — and House Majority Leader Kevin McCarthy (R-Calif.)  predicted while on a trip to Israel last week that “knowing what I know about the agreement, at the end of the day, it’ll be disapproved,” according to Israeli news site Arutz Sheva.

[Iran lobbying campaign using all forms of social media]

In fact, there is not a single Republican House member that has stepped forward to take a publicly supportive, or even receptive, stance toward the deal. And in the Senate, the only Republican  (Arizona Sen. Jeff Flake) who seemed open to embracing it decided against doing so over the weekend.

It takes 218 votes to get legislation passed in the House. With 246 Republicans, the majority can clear that opening hurdle with room to spare.

But that’s not the whole story.

The Tension: The Senate

A lot of attention is focused on whether congressional Democrats will be able to collect enough support to sustain the president’s veto. But before things get to that point, there is a chance – in no way a given, but a chance – that Senate Democrats could actually keep Obama from needing to flex his veto pen.

Opponents need 60 votes to overcome a filibuster and secure a resolution disapproving the agreement, sending it to the president’s desk.

There are 54 Senate Republicans, and ever since Flake declared his opposition over the weekend, it’s safe to assume that none are really looking to support the deal. Assuming no last-minute epiphanies or surprises, that’s 54 out of 60 votes for the opposition.  Schumer and Menendez are also against the deal, bringing the count up to 56. If Sen. Ron Wyden (D-Ore.), who we have in the leaning “no” category, joins them, that number would rise to 57.

That gives the White House wiggle room to lose up to three more Democratic senators — but no more. While many Democrats are diligently stepping forward to declare their fealty to the deal, there are still about 12 who haven’t made their intentions known clearly enough to place in one camp or the other. The White House needs to keep at least 10 of those remaining undecided Democrats on board to prevent Congress from sending a disapproval resolution to Obama’s desk.

Even if the House passes the disapproval resolution, if it fails in the Senate, that’s it: the agreement sticks and the deal is a go. But if the Senate passes the resolution too, then we move on to gaming out a veto-proof majority.

The Backstop: The improbable veto-proof majority. Especially in the Senate.

Should both chambers pass a disapproval resolution and send it to Obama, we already know that he plans to veto it. And we know the only constitutional method of getting around that veto: Congress must outvote the president with a two-thirds supermajority in each chamber.

Now we get into a game of probabilities.

Not enough House or Senate Democrats are behind the deal to say definitively that the president can sustain his veto. In fact, in the House, we only know where slightly more than half of the Democrats stand: 88 of the 188 Democrats have neither declared themselves nor tipped their hand.

House Republicans, assuming they all hold rank, need 44 Democrats to join them in order to sustain a veto-proof majority against the president. Already, of those who have declared, 12 House Democrats have pledged to vote against the deal, and we count another six as leaning strongly that way — meaning opponents need only 26 of the remaining 88 undecided Democrats to oppose the deal in order to trump the president.

If this were a question of pure probabilities — where each undecided lawmaker stood an equal chance of voting “yes” or “no” — it would be all but a given that the deal’s opponents would win enough support to override a veto.

But politics isn’t as random or mathematically pristine as flipping a coin – lawmakers can be swayed by the president, their party leaders, lobbyists and their constituents, among many other factors. Cumulatively, those things might actually make it quite difficult for 26 House Democrats to break from the president’s position. Especially when you consider the following: Of the 150 Democratic lawmakers who cheered on Obama’s negotiation efforts in a letter this spring, not a single one has yet pledged to vote against the deal. The White House needs 146 House lawmakers to sustain the president’s veto.

But even if enough House Democrats support a veto-proof majority in the House, there is a firmer backstop in the Senate.

According to the Post count, opponents would need to lure 10 of the approximately 12 undecided Senate Democrats to their side.

Applying the same logic as in the House, if each undecided senator could just as easily vote “yes” or “no,” there would be less than two  percent chance of the Senate overriding the president’s veto. But this is the world of politics, not probabilities, and that makes it even less likely – at this point – that so many Senate Democrats would oppose the White House on a deal this potentially historic.

The stakes could rise sharply as more lawmakers declare themselves. But as of now, the Iran deal should hold — perhaps only with a veto, and perhaps only in the Senate, but it should hold.

Even Senate Majority Leader Mitch McConnell (R-Ky.) seems to think the odds of Congress upholding a veto, and thus  deal, are “obviously stacked in the president’s favor,” the Associated Press quoted him as telling a business group in Kentucky on Monday.

Yet in politics, you can never be entirely sure until the votes are cast.

Amber Phillips in Washington, D.C., and Andrew Roth in Moscow contributed to this report.

Correction: The original headline, due to an editor error, said Congress was likely to overturn Obama’s veto. This story has also been updated to say that Iran deal opponents would need to lure 10 out of 12 Senate Democrats to overturn the deal, giving them a less than two percent chance of doing so.