Mitt Romney’s victories in Arizona and Michigan last week dampened talk about a brokered convention or a white-knight candidate. But Republicans still face the possibility of a protracted nomination battle in which the steady accumulation of delegates becomes the ultimate marker of success, rather than a quick string of victories that drives all but the winner to the sidelines.

Republicans haven’t had such a fight since 1976, when the nomination contest between Gerald Ford and Ronald Reagan went all the way to the convention in Kansas City, Mo. Democrats had one just four years ago, when Barack Obama finally prevailed over Hillary Rodham Clinton in large measure because his campaign had a superior plan for winning delegates and the discipline to execute it.

Obama’s delegate operation was a textbook case in the annals of presidential politics. Jeff Berman, who oversaw the operation, has laid it out in rich detail in a new book, “The Magic Number.” He shows how preparation, attention to detail, ruthlessness, resources and good luck can add up to winning a presidential nomination. Delegate trackers for the Republican candidates — particularly Rick Santorum, whose stumbles on this front will prove costly Tuesday — might wish they had read Berman’s account months ago.

Most nomination battles are won or lost on momentum rather than the hand-to-hand competition over delegates. A good delegate strategy becomes important only when it’s needed. By then it’s too late to put one together. The absence of a good delegate operation is an early warning signal of a campaign ill-prepared for whatever might be coming.

The failure of Santorum and Newt Gingrich to qualify for Tuesday’s primary ballot in Virginia is an example of what can happen to a small, underfunded or disorganized campaign. Santorum’s failure to file for 18 of the delegates at stake in Ohio compounds his mistakes. Romney advisers said Saturday that Santorum has flunked a key test of organizing. They are correct.

Berman’s story underscores just how early the preparation of a delegate plan must begin. In the summer of 2007, when Obama badly trailed Clinton in national polls and was struggling to find his voice as a candidate, campaign manager David Plouffe signed off on Berman’s proposal for a delegate operation that was built on the assumption that the Democratic race might not be over after the earliest primaries and caucuses. Clinton’s team, in contrast, was woefully late in coming to the same conclusion — or at least preparing for it.

Delegate tracking requires an intimate knowledge of the rules that govern the primaries and caucuses. This involves more than knowing and meeting the filing deadlines to qualify for the ballots in every state. The Democratic rules are particularly arcane. It is a job for lawyers, as Berman, who is one, makes clear.

The Obama campaign not only knew the rules but pushed to make sure they favored them when possible. Berman describes just how hard the Obama team worked, much of it behind the scenes, to make certain that the primaries in Michigan and Florida, two states that had violated Democratic Party rules by advancing the date of their contests, were disqualified and therefore meaningless. Plouffe said after the campaign that had Florida been a real primary rather than one that didn’t count, Clinton might have won the nomination.

Knowing the rules is just a start. Applying them takes political smarts as well. Putting the rules together with the demographics and voting histories of every congressional district in the country is critically important in the development of a delegate plan that can maximize a candidate’s strengths and offset weaknesses.

Republican rules generally have been far simpler — a candidate who wins a state or a congressional district is usually awarded all the delegates in that jurisdiction — until 2012. This year Republicans have turned to a system that requires many of the states to allocate delegates proportionally, though without a consistent definition of proportionality.

GOP campaigns are being forced to think about the nomination battle in new ways, knowing that a shrewd expenditure of resources, deployment of organizers and allocation of candidate time can make the difference between victory and defeat. The Obama campaign plan is not a perfect blueprint for Republicans this year, but it is a guide to how the game is played. Berman’s story helps to demystify the process.

One basic part of Obama’s strategy — and perhaps the piece that broke the back of the Clinton campaign — is well known. That was the decision to concentrate energy and resources on states with caucuses, where Obama’s appeal to grass-roots activists could return the biggest dividends.

Obama’s big victory margins in many of those caucuses in January and February 2008 provided the bulk of the delegate lead he rolled up early in the campaign — and proved just enough to hold off Clinton when she began her comeback in the spring of that year. One example: Obama netted 12 more delegates than Clinton in Idaho’s caucus, though just 18 delegates were at stake, while Clinton netted 11 more than Obama in the New Jersey primary, where 107 delegates were at stake.

But there was much more to the Obama plan. Berman describes the care that went into determining congressional district targets in states where Clinton was favored. Evidence of how this paid off is clear from a comparison of the delegate tallies from the two candidates’ home states, both of which held primaries on Super Tuesday in 2008. Clinton netted fewer delegates from New York than Obama netted from Illinois, even though New York had more delegates overall.

Delegate tracking doesn’t end with primary or caucus day. Caucus states in particular can change dramatically as the process moves from precincts to county conventions and eventually the state convention. The Obama team fought to expand the number of delegates in a number of caucus states, with success. Two months after the Iowa caucuses, Obama’s team managed to increase the candidate’s margin in the Hawkeye State by 11 delegates. As Berman writes, “We’ve negated Hillary’s seven-delegate win of 11 days earlier in the Ohio primary.”

Obama’s team scratched for every single delegate. Berman opens his book with the story of the campaign’s successful effort to gain one additional delegate in South Carolina with hardball tactics at the state convention in May 2008. Most people were focused that weekend on upcoming primaries in North Carolina and Indiana. Berman and others spent their energies nailing down that single extra delegate, even at the expense of blocking one of the state’s most popular Democrats, who wanted the slot but declined to pledge his support to Obama.

Last week, Santorum got a taste of the delegate wars in Michigan. The former Pennsylvania senator’s team had crowed about winning an even split in delegates there, despite narrowly losing the popular vote. Then Michigan Republicans invoked a little-known rules change and awarded both at-large delegates to Romney rather than splitting them between the two top vote-getters. Santorum’s team cried foul. It’s not likely they will get that delegate back.

The Republican race may never get to the point of being a true battle for delegates, but the longer it lasts, the more those delegate numbers will come into play. The Obama team showed that gaining an advantage is crucial, and controlling the narrative about the state of any delegate competition is just as important. On the eve of Super Tuesday, Romney’s team has the edge over his rivals on both counts.