That’s it, the election is over, and the winner is not Theresa May or Jeremy Corbyn, but nobody. Parliament is “hung”: that is to say, no party is able to command a working majority in the House of Commons. A “working majority” means having more seats than the other parties added together, plus one. Think of that as the magic number.

What that magic number is varies slightly. The absolute most it could be is 325, as the Speaker of the House has a seat but does not vote. But as Sinn Féin do not take their seats in Parliament, any seat they win in Northern Ireland reduces the magic number still further.

On an absolutely magnificent night for Sinn Féin, the best result they could hope to win out of Northern Ireland’s 18 parliamentary constituencies is seven – meaning that the “magic number” for a majority would actually only be 318.

Although when we think of a hung parliament, that suggests an arrangement in which any party could govern, in actual fact, the words “hung parliament” mean three different things.

The first is what you might call a “hung parliament – Conservative minority government”. The Conservative minority zone is much smaller than its equivalent Labour zone.

Why? Because what matters if you don’t have a majority is how many of the other parties you can persuade to work with you. In practice, there are only two parties that are natural allies for the Conservative Party – the two Unionist parties, the Democratic Unionist Party (DUP) and the Ulster Unionist Party (UUP) – which means that in order to be able to pass laws the Conservatives can’t really afford to fall more than 11 seats short of a majority, as that is the absolute most that those two parties could win of the 18 seats up for grabs in Northern Ireland.

But of course – this is where the question of how Sinn Féin do comes into play. Don’t forget that every seat they gain reduces the threshold that any party needs to win a majority. The absolute best result for the Conservatives out of Northern Ireland would be for the two Unionist parties to take 11 seats, and for Sinn Féin to take four of the remaining seven. Those missing four seats bring the threshold down to 321 seats, which when you add those 11 Unionist seats means that the Conservatives aren’t in danger of falling out of power provided they hold onto 311 seats.

Then on mainland Britain, there is really only one other party that might pal up with the Conservatives, but they’d be very reluctant to do so: the Liberal Democrats. They’ll only work with the Tories as a last resort, so while the Conservatives might in a pinch be able to stay in office if they need the Liberal Democrats, you wouldn’t want to bet on it were you Theresa May.

So in this scenario: the Conservatives would have lost up to 20 seats, but either would be able to govern with the support of the Unionist parties, or the numbers for an alternate arrangement featuring Labour and the Liberal Democrats wouldn’t be there.

In that situation, there would be a Conservative Prime Minister, but it wouldn’t be Theresa May. She would have pissed away a small but workable Conservative majority on an election she didn’t have to call. The most likely beneficiary would be David Davis, as he is acceptable to the Brexiteers, and, equally importantly, is getting on in years. The Conservatives’ younger stars would fall behind him quite quickly in that scenario.

But that’s quite unlikely, because the most plausible hung parliament scenario is this: “hung parliament – Labour minority government”. The number of seats Labour needs to form a government is much, much smaller than the Conservatives. They only need to win enough seats to be able to reach the magic number with the support of the SNP, the Liberal Democrats, the Greens, Plaid Cymru and the SDLP, the centre-left Irish nationalist party.

The absolute most all those parties could win at the same time is 78. (That includes some overlaps: Plaid Cymru could win Ceredigion, for example, from the Liberal Democrats, but I have only counted it as an “anti-Conservative” seat the once.)

That would mean that Labour would only need to make 15 direct gains from the Conservatives to form a minority government, though for those numbers to work they would need the SNP to hold off the Scottish Conservative advance, and for the Liberal Democrats to make gains in South West London and St Albans.

(Their best case scenario out of Northern Ireland is one where the SDLP hold all three of their seats and Sinn Féin take six – bringing their “magic number” down to 316, and decreasing the number of seats they would need to take from the Conservatives to just 11.)

But essentially, for every seat Labour gains that takes them above 247, the better their chances of forming the next government, albeit one reliant on the kindness of strangers. A hung parliament is a much less difficult scenario for Labour than for the Conservatives. But of course, for every seat Labour wins itself, the more it can get done without cutting deals.

The biggest consequence of a Labour minority administration would be that Britain would almost certainly remain in the single market and have a vote on the deal, as those two items are non-negotiables as far as the SNP, Plaid Cymru, the Greens and the Liberal Democrats are concerned.

That government might be quite stable, albeit less left-wing than a Corbyn-led government in possession of a majority, and it would very quickly start to fray on the edges over PR, an issue which around half of Labour MPs vehemently oppose.

But there’s another scenario, what you might call the genuine hung Parliament: one where neither Labour nor the Conservatives can cobble together enough allies to form a government.

In that case, what would likely happen is a repeat of 1974: the largest party staggering on for a few months until another election, when it would hope to get a majority of its own. Couldn’t happen? I offer only this small historical echo. In 1974, Labour members forced a radical manifesto on Labour MPs, and the party emerged as the largest in a hung parliament after the sitting Conservative PM decided to go for an early election to “strengthen their hand” (in this case, against the trade unions not the European Union).

The slim possibility of re-run shouldn’t be discounted.