Seth Allen did this, but in a more controlled setting, to win the game. (AP)

Mark Turgeon doesn’t pretend to be a mathematician. He’s a basketball coach through and through. So forgive Maryland’s second-year coach if emotions seeped into the scientific section of his brain, rendering him unable to multiply 500 by 14.

The answer is 7,000, he was later told by a reporter. The number of free throws the Terrapins shot this week. Each player took 500. It was a lesson. No more shooting 55.6 percent from the line, as Maryland did against both Virginia and Wake Forest. No more shooting below 60 percent, as the Terps have done in six of their past nine ACC games. The message was simple: Get to the line often, and make your free throws.

And so it was that Maryland shot 34 free throws in Saturday’s 83-81 upset over second-ranked Duke, its most attempts by six since conference play began Jan. 5.

Even better, the Terps made 25 of those for a rate of 73.5 percent, their best since shooting 6 for 8 in that 51-50 upset over North Carolina State. Alex Len and Seth Allen were each 7 for 8. Shaquille Cleare was 3 for 3 and Nick Faust was 2 for 2.

For comparison’s sake, that’s as many free throws as Len made in his past five games combined. Allen hadn’t attempted more than six in any game this season. Faust entered a paltry 8 for 15 (.533) from the stripe in ACC play.

“The key was we got to the foul line,” Turgeon said. “We haven’t shot 34 free throws in a long time. We drove the ball, we were aggressive, we stepped up and made a lot. Still weren’t great, but a better percentage.”

The game’s biggest free throws came by accident. With 16 seconds left and the score knotted at 81, Turgeon called a timeout to concoct the final play. It would be a double screen for Logan Aronhalt along the baseline. Duke would switch, which they did. After that, Jake Layman would go into a cross-screen for Len, with the intent of freeing up the center on the low block.

As the play began to unfold exactly as scripted, Len got caught in traffic amid some contact, unable to fully spring free. So Allen idled at midcourt, defended by Quinn Cook, waiting until Cook made a mistake. Once the guard peeked for an oncoming screen, Allen sprung right, blowing past Cook, forcing a desperation foul that sent Allen to the line for what wound up being the game-winning free throws.

“Seth pulled it out at the time,” Faust said. “He’s a strong-headed guy, and I keep telling him things to keep him going and keep pushing. He finished the game strong.”

Throughout the week, Allen made 427 of 500 free throws. He arrived a few hours before shoot-around and made 85 of 100. Few, however, wound up with him laughing before releasing. At the line, Duke guard Tyler Thornton jawed at Allen. Faust cracked an inside joke, which helped relax Allen.

“Nothing really,” Allen said, when asked if anything was different on that trip to the stripe. “Just to make the free throw shot. Coach told us we had to shoot 500 free throws as individuals before this game. I just got comfortable in my routine and just tried to knock them down.”

As easy as simple multiplication.