Running elections isn’t cheap. Running a presidential election in a swing state during a global pandemic while an unprecedented flood of mail ballots threatens the possibility that the actual results won’t be known for days? That’s expensive.

First, Pennsylvania counties bought new equipment because a new law allows any voter to vote by mail.

Then they bought more before the June 2 primary, as coronavirus fears of in-person voting fueled a massive surge in mail ballots, far beyond what was expected.

Now, in the months since, counties have scrambled to buy much more equipment, spending millions of dollars to prepare for a huge volume of ballots and prevent a long, drawn-out vote-counting process.

Even just the number of high-speed scanners, which counties use to tally mail ballots, has increased significantly. Chester County had only one before the 2019 law was enacted. It bought another after, and now it has purchased a third, which cost about $116,000

Philadelphia had four high-speed scanners and bought eight more after the primary. Montgomery County had five and has since bought 10 more. Bucks County bought six, bringing its total to 10.

“We knew we would have to double our capacity here in terms of equipment and staff,” said Lee Soltysiak, Montgomery County’s chief operating officer and clerk of its elections board.

It’s been clear for a while that counting mail ballots could lead to long waits to call races, but the pandemic accelerated and compressed the transition to voting by mail, with the state jumping from 5% to 50% of votes cast by mail in less than a year. State officials expect about three million votes to be cast by mail this election (more than two million mail ballots have already been requested). But officials aren’t legally allowed to start counting them until polls open on Nov. 3. That means it could take days to call a winner in Pennsylvania, a state increasingly expected to play a decisive role in determining who wins the presidency.

Officials are particularly worried about what happens while they count — and the world waits.

Democrats are more likely than Republicans to vote by mail, especially after months of false attacks on the method by President Donald Trump. That means there will likely be what’s known as a “blue shift” in the days after Election Day: The Republican-leaning in-person votes are counted first, making it seem Trump is winning handily, until the disproportionately Democratic mail ballots are slowly counted.

Complicating things further, the state Supreme Court on Thursday extended the deadline to allow ballots to be counted if they are received up to three days after Election Day. That increases the chances that thousands more mail ballots will need to be counted after polls close. It could be difficult to know even how many votes are still uncounted.

And if the world goes days without knowing who won, misinformation and disinformation could fill the void, damaging public trust in the election and undermining its legitimacy.

No pressure.

“It doesn’t mean people shouldn’t have confidence in the results, it just means they have to have patience for the results,” Soltysiak said. “That’s the frustrating thing — not so much that it’s taking longer. … It’s the wringing of the hands and the skepticism that it can lead to.”

Thus the mad scramble to buy equipment and increase staff. In the primary, most votes in the Philadelphia region weren’t counted by election night. A week later, half the state’s counties were still tallying votes. There will be twice as many votes to count in the general election.

“We ... didn’t have any of this machinery that we have now. It was literal human beings doing everything,” said Bob Harvie, the Bucks County commissioner who chairs the elections board.

Some of it is equipment that counties didn’t even realize they would need, such as letter openers that quickly slice open envelopes or more sophisticated “extraction tables” that both open envelopes and remove ballots from them.

Philadelphia, for example, went from using the less-efficient letter openers in the primary to buying 22 extraction tables. Montgomery County didn’t have any ballot extractors in the primary, and bought 15 after.

Workers install equipment for processing mail ballots at the Pennsylvania Convention Center in Philadelphia on Sept. 17. Elections officials in the city and elsewhere have spent millions on sophisticated equipment for processing, sorting, opening, and counting mail ballots, in an effort to avoid a long wait before results in the 2020 presidential election are known.
ALEJANDRO A. ALVAREZ / Staff Photographer
Workers install equipment for processing mail ballots at the Pennsylvania Convention Center in Philadelphia on Sept. 17. Elections officials in the city and elsewhere have spent millions on sophisticated equipment for processing, sorting, opening, and counting mail ballots, in an effort to avoid a long wait before results in the 2020 presidential election are known.

There are plenty of other equipment costs, such as the 40-foot-long ballot sorters that cost more than $500,000 each — Philadelphia is buying two — and ballot drop boxes, printers, ballot folders, and more. Then there are various other costs, such as expanded office space to house equipment and workers, and upgraded security to protect it all.

Counties are also shelling out for significantly higher staffing. They’ve got an aggressive but simple new plan for how to make use of all those people and all that equipment: Once they start counting ballots on Election Day, they won’t stop.

“We’re planning on running 24 hours a day,” Harvie said. “Once we start opening ballots, we’re going to have different shifts where we’re never going to close the doors of the Board of Elections.”

That’s a significant departure from the past, when counties would process votes late into the night but eventually send everyone home, continuing to count ballots as part of lengthy workdays following an election. This year, those workdays won’t end.

The counting won’t stop either in Philadelphia, nor in Chester, Delaware, and Montgomery Counties. Together, the five Southeastern Pennsylvania counties have more than one-third of Pennsylvania’s registered voters. They will have to count hundreds of thousands of mail ballots — perhaps more than a million.

“We’d like to be done ... by the end of the week,” Harvie said of counting ballots in November. “I know that’s ambitious, but we’re going to do everything we can to make it happen.”

The primary was a wake-up call, elections officials said. They knew counting ballots would take time, but they’re determined to avoid such a prolonged process in November. Some races took weeks to determine a winner.

“One of the lessons learned we had was: If we threw more people at the problem, we could do this faster,” said Chester County administrator Bobby Kagel. The county on Thursday put out a call to government workers to help count ballots the week of the election, with about 200 people a day working across three eight-hour shifts.

The round-the-clock staffing will help prevent bottlenecks as ballots move through the counting process. In Philadelphia, for example, about three times as many ballots can be scanned every hour as can be removed from their envelopes and prepared for scanning. So while the actual counting of ballots may occur in batches a few times a day, the tedious work of opening envelope after envelope — about 12,000 an hour — will continue without stoppage.

And in another first, Philadelphia elections officials plan to begin counting ballots on Election Day. In the past, they didn’t open mail ballots until after, focusing their staff on running the in-person election.

“We’re just changing with the times that have changed around us,” said Lisa Deeley, chair of the Philadelphia city commissioners, who run elections. “We’re going to do the best we can to get that count accurately and as quickly as possible, and I think that we’re going to be in a good place to get it all done.”