None of the Parx-based horses hit the board in either of the $1 million races Saturday, but the winners each had a local connection. And if you were smart enough to put 7-1 Cotillion winner Street Band with 31-1 Pennsylvania Derby winner Math Wizard, you are 1) a horse racing genius and 2) $578.60 richer for each $2 bet on the double that included the 10th and 11th races at Parx.

The Pa. Derby went off the rails at the start. Just as the six horses finished loading into the gate, Parx-based Spun to Run reared up. That appeared to cause 6-5 favorite Improbable, a notoriously bad gate horse, to jump up as well. Improbable was still not completely settled when the stall doors opened and the colt broke well behind the field.

So the horse that figured to be first was last. None of the other horses really wanted the lead. Mr. Money, going for his fifth straight stakes win, inherited the front, a spot his trainer Bret Calhoun did not want him to be.

The fractions were tepid. Improbable slowly worked his way back into the race and had every chance in the stretch. But it was Math Wizard, coming with an outside run under the best imaginable substitute jockey, Irad Ortiz. Jr., that had the momentum in the stretch, just enough to beat Mr. Money by a neck. The first five horses across the line were separated by just 1 1/2 lengths.

John Fanelli, who runs horses at Parx with leading trainer Joe Taylor, is the majority owner of Math Wizard, a horse he claimed for $25,000 on Jan. 31 at Gulfstream Park when he won by 18 1/2 lengths. It was the third straight race in which Math Wizard was claimed. Fanelli won a seven-way shake, meaning six other owners had tried to claim him.

The horse ran respectably in several 3-year-old stakes, but was badly beaten by Mr. Money in the West Virginia Derby. The connections made a last-minute decision to fly the colt up from his South Florida base for the biggest race of his career.

Math Wizard was not exactly flying at the finish, but was going fast enough to get home in front, running the mile and an eighth in 1:50.94. Trained by Joseph Saffie, a native of Barbados who won the Barbados Triple Crown in 2009, Math Wizard’s first win since the claim could not have been better timed.

The trainer was trying to talk Fanelli out of running. It was only $2,000 to enter so they did.

"At least it gives us a few days to decide,’’ Fanelli said to his trainer.

They decided to come.

"If you’re not in it, you can’t win it,’’ Fanelli said,

They were in it. They won it.

Cotillion winner Street Band is trained by Larry Jones, no stranger to the Parx winner’s circle. He had really good Pennsylvania-bred Hard Spun, who finished second in the 2007 Kentucky Derby. He also trained I’m a Chatterbox, the 2015 Cotillion winner.

Street Band, who was way, way back early, came wide on the far turn and ran down odds-on favorite Guarana in the stretch. The filly was ridden perfectly by Sophie Doyle, a native of Cambridge, England.

Joe Mishak, who grew up at Grant and Academy in Northeast Philly and had his first horses at Parx with trainer Ron Glorioso, is the racing operations manager of MyRacehorse, a group that has a minority interest in Street Band.

"I grew up here coming to the track every day,’’ Mishak said. "Our dream is to make every fan an owner in this industry. We do that through our micro-share program.’’

The MyRacehorse group bought into Street Band after she won the March 23 Fair Grounds Oaks.

Now, Mishak’s My Racehorse group owns a piece of a Grade I winner. By winning the Cotillion, they also got an all-expenses-paid trip to the Breeders’ Cup in November at Santa Anita.