In 2016, the most important number is 1,237: the number of delegates required for a candidate to win the Republican presidential nomination outright.

As front-runner Donald Trump, Texas Sen. Ted Cruz and Ohio Gov. John Kasich battle fiercely for the remaining delegates on the table between now and the end of the primaries in June, everyone is scrambling to keep track of the delegate count. It's a figure that changes frequently, based on results of states' primaries and caucuses as well as on the delegate selection processes that are taking place across the country this spring.

The truth is, it's extraordinarily complicated for a handful of reasons to know who has how many delegates because each state allocates differently -- and in many states, the way delegates are allocated and selected isn't entirely based on the outcome of the state's primary or caucus.

Get Breaking News Delivered to Your Inbox

Further complicating matters is the issue of what happens to delegates won by candidates who have dropped out of the race, like Florida Sen. Marco Rubio. That's also different based on each state's rules, and means that at the start of the convention a not-insignificant portion of the available 2,472 delegates will be out of commission for the three remaining candidates.

Plus, as Cruz and Kasich are banking on, all that math goes out the window after the first ballot at the convention, when many delegates are no longer bound to vote for the candidate that won their state's delegates, but instead can vote their conscience. That's why Trump supporter and Maine Gov. Paul LePage was so incensed last weekend when Ted Cruz got his supporters into 19 of the state's 20 delegate slots: those delegates are required to vote proportionally based on the state's caucus results on the first ballot, but then are free to defect to whomever they choose.

In a handful of states, the processes for selecting delegates are completely divorced from what happens at the ballot box, which is a big part of why the delegate math going into the convention in Cleveland is so difficult to predict. With all these arcane rules that are different in every state, what's a political junkie to do? Here's CBS News' guide to the states with the craziest delegate rules this year:

PENNSYLVANIA: 71 delegates

Pennsylvania, which votes on Tuesday, does hold a presidential preference primary where voters in each party will cast their ballot for the presidential candidate of their choice.

But that's not where the biggest trove of delegates comes from: in fact, in Pennsylvania, the majority of the state's delegates have nothing to do with the overall statewide vote. Of the 71 overall delegates Pennsylvania will send to Cleveland in July, just 17 are based on Tuesday's presidential primary results -- the remaining 54 are elected directly on the ballot.

That means these local delegate candidates had to gather signatures, get themselves on the ballot and work to garner support locally so voters check their name along with the name of their preferred presidential candidate. And while those delegates can pledge themselves to a particular delegate if they choose, they're in no way bound to that decision through Cleveland--meaning, on the path to 1,237, Pennsylvania's delegates will be getting a lot of attention from the candidates well after primary day Tuesday.

NORTH DAKOTA: 28 delegates

North Dakota Republicans didn't cast a vote for their preferred presidential candidate at all--and their delegates were chosen by a group of state party officials.

In past presidential election years, North Dakota Republicans have held a non-binding straw poll in the spring. This year, though, the Republican National Committee mandated that all primaries and caucuses be binding--a move that, in theory, should have prompted North Dakota to adopt similar rules to other states.

Instead, state party leaders there decided they didn't have enough time to put together a set of rules governing 2016 caucuses by the RNC's October 1, 2015 deadline. They ended up canceling the caucuses entirely, opting instead to choose all their delegates at a state convention one weekend in April. Though the delegates go to the convention as free agents, 10 of the 28 told the Associated Press in early April that they were supporting Cruz.

"I think it's important to note that our delegates have never been bound and our rules are staying the same as they've always been," Kelly Armstrong, the state's GOP chairman, told local TV station KFYR-TV at the time, saying the process will change in future years. "It's only through a change in RNC rules that we got into this position. It really was a timing issue. We simply didn't have enough time to develop caucus rules."

COLORADO: 34 delegates

Colorado, too, opted not to hold any sort of presidential preference vote in 2016. The state's Republicans canceled their presidential primary this year in favor of holding local-level caucuses that had nothing to do with the presidential race. At those caucuses, GOP voters were able to help elect local-level party leaders but not cast any votes at the presidential level.

Colorado GOP Chairman Steve House said earlier this year that the idea of a presidential preference straw poll is an "unacceptable gamble" when delegates are bound based on its results.

"There is no such thing as a binding preference poll because when you actually award delegates via a poll it's not a poll -- it's an election," he said in a statement defending the decision. "So what's wrong with an election? Nothing -- if you are actually going to run it with all the precautions and security measures of an actual election."

Cruz gained the support of all 34 of Colorado's delegates, prompting a cry of foul play from the Trump campaign.

WYOMING: 26 delegates

Wyoming's system has, in the past, involved about half its delegates being allocated at county conventions and half at the state convention.

With this year's RNC rules changes, though, its system became more complicated: Wyoming still held precinct-level caucuses before March, but that was a vote to select delegates to the county convention -- the state did not have a presidential preference vote. Then, the state held county conventions on March 12 to elect 12 delegates, with the remaining 14 selected at their state convention in mid-April.

Cruz won all 14 of the available delegates in April, and won 9 of the 12 available delegates in March.