House Minority Leader Nancy Pelosi, the top House Democrat and the only declared Democrat candidate for speaker, is reportedly having issues securing a majority of 218 votes in the new Congress that will be seated next year. That is the requisite number of members she needs to publicly cast votes for her on the Floor if she wants to regain the speaker’s gavel in the next Congress now that Democrats have retaken the House majority.

Pelosi, who served as speaker before Democrats lost the House to Republicans in the 2010 midterm elections in former President Barack Obama’s first term, weathered the storms of her conference and stayed atop the Democrat Party in the House for eight long years as House minority leader awaiting the return of Democrats to power. Now that the Democrats have regained the majority in the House in November’s midterm elections, a new majority will be seated in early January at the end of this current Congress, and Pelosi is the only declared candidate for speaker.

But just like her immediate successor, Republican and former Speaker John Boehner found out the hard way after three years of coup attempts by conservatives, the final of which was eventually successful in mid-2015, Pelosi needs to hold together at least 218 votes from a rambunctious and very divided conference with a diversity of viewpoints on everything from whether Democrats should impeach President Donald Trump to how Democrats should handle policy on matters like taxation, immigration, trade, national security, and more.

For now, Pelosi’s biggest strength in pushing herself to become speaker again is that her intra-party opponents–per Politico–cannot find a viable, or even plausible, candidate to rally around in opposition to her. “The House Democratic rebels trying to keep Nancy Pelosi from becoming speaker have a big problem: They can’t seem to find someone to run against her,” Politico‘s Rachael Bade and John Bresnahan wrote on Monday.

But, in the very next paragraph, Bade and Bresnahan broke this big tidbit: Pelosi’s Democrat opponents in the House say they have the votes to stop her from regaining the speakership.

“The naysayers claim they have the 15 to 20 votes it would take to block Pelosi on the House floor,” Bade and Bresnahan wrote. “But so far, no one’s stepped up as an alternative, and it’s unclear who might. Also unknown is whether that person would have a prayer against the experienced Pelosi, as flawed as her detractors say she is.”

When all is said and done from last Tuesday’s midterms–there are still nine outstanding House races–Democrats could have a majority as high as 236 seats but definitely will have at least 227. That final number is going to be critical for Democrats’ hopes of securing Pelosi as speaker, as every number extra that Democrats add to the final total is an extra vote Pelosi can afford to lose.

If Republicans sweep those nine remaining races, a very unlikely outcome, and Democrats enter the new Congress with 227 votes, Pelosi can only afford to lose nine Democrats on the floor. Democrats, however, are very likely to pick up a number of the nine outstanding seats. They currently lead Republicans in four of them: California’s 10th District, New Jersey’s 3rd District, New York’s 22nd, and Utah’s 4th District. Republicans lead Democrats in the other five: California’s 39th and 45th Districts, and Georgia’s 7th, as well as Maine’s 2nd, and Texas’s 23rd Districts.

If these races are finalized the way they stand now, Democrats will have 231 votes in the House–which means Pelosi can afford to lose 13 Democrats in her bid for the speakership–but if they all go to the Democrats in the end, Democrats would have 236 votes, and Pelosi would be able to afford to lose 18 votes from Democrats in the speaker’s race.

In other words, depending on how these final races shake out, Pelosi’s margin for error could be anywhere from nine to eighteen votes; the higher the number, the harder it is for the intra-conference rebels to successfully block her.

One place where anti-Pelosi Democrat rebels could learn from anti-Boehner GOP rebels from a few years ago is strategy when it comes to stopping a presumed speaker. There were three coups against Boehner, the first two nearly successful but ultimately failed, and the third one successful.

First and foremost, despite Pelosi’s allies pushing the narrative that a challenger to her must emerge, that is not true. They can vote her down, and then most certainly after she would have failed to reach 218 votes on the first ballot on the House floor, then plausible challengers would emerge. The way a speakership vote works is at the beginning of any Congress, the newly sworn-in members must elect a speaker. Candidates are declared–usually just the leader of each party–and then roll is called, and each member’s name is called out, in alphabetical order, and the members vote for either candidate or for an undeclared candidate.

Members can vote for anyone eligible for the speakership, and that does not mean they need to cast votes for a sitting member of the House. In fact, some of the GOP rebels against Boehner in different cases voted for people like Sens. Rand Paul (R-KY) or Jeff Sessions (R-AL). Some even voted for former Rep. Allen West (R-FL).

Assuming all 435 members of the House vote–and vote for a person, not “present”–then the winning candidate would need 218 votes to take the speakership. Voting “present” cancels the vote caster’s vote, as it means the vote is not counted toward the larger total and lowers the threshold required for a candidate to win. Another talking point likely to emerge from the Pelosi camp–an inaccurate one that Boehner’s allies pushed to try to protect him–is that doing this, voting for someone other than Pelosi, could hand the speakership back to the other party. This is not true. A winning candidate must receive a majority of votes cast for a candidate (declared or undeclared), so if Pelosi fails to get to that majority on the Floor, the speakership race would go to a second ballot–and it is there or on later ballots, as it keeps going until someone wins, that presumably any true challenger with an actual chance at winning would emerge.

So if the Democrats’ anti-Pelosi rebels want to actually win, they can–by just getting at least anywhere from 9 to 18 votes from House Democrats for someone other than Pelosi. After denying her the speakership on the first ballot, they can allow whoever their candidate is to emerge–or they can force all sorts of horse-trading on changes in leadership structure in the party or a debate between candidates, or basically anything else they want to happen, and withhold their votes from a weakened Pelosi beholden to them until such time as they are good and ready to either vote for her or vote for someone else.

Another thing anti-Pelosi Democrats can learn from the last generation of rebels is the need to be public with one’s intentions before the vote comes down. If they have the numbers, as Politico reports they say they do, they need their members to issue public statements announcing their intentions to vote against Pelosi and for someone new.

The first coup attempt against Boehner, in early 2013, was a closely-held, secretive plan that did not involve much public interaction. The second coup attempt, in early 2015, was much more public; many members had said they would not vote for Boehner. But as Rep. Louie Gohmert (R-TX) would recall after it failed, “We had enough votes, but people that were right there ready to go ended up deciding not to vote with us.”

It is much easier for politicians to weasel out of a tough decision–opposing the anointed leader of one’s own party is easy to talk about in private, but to actually do it in public on television with the whole world watching is much tougher–if they are not committed ahead of time. Most of those involved in the anti-Boehner coup efforts regret not having all the members involved publicly declare their intentions to oppose Boehner ahead of time; doing so would have made it very difficult to switch positions and also would have made it less of a shocker or surprise for the media and wider general public when they did do what they said they were going to do.

Politico‘s report on the anti-Pelosi rebels on Monday includes a huge bright spot for those Democrats who would like to see someone else as speaker: There is a “leader” of the movement, a sitting Democrat House member, quoted on record in the piece. Rep. Ed Perlmutter (D-CO), a leftist Democrat House member first elected in 2006, is quoted in Politico discussing the strategy: