Can you work in some type of brain break or walk before math? I've had classes where we stood up and stretched to refocus. Or play some kind of calming music (rain, ocean sounds?) and have a minute of mediation...
If that doesn't work, I'd let them jump up and down or do something physical to music for a minute or two if they want to. They sound done at 2:30!
Have you ever looked into Whole Brain Teaching?
https://wholebrainteaching.com/
Not sure if it will work for you, but it does refocus their energy a lot.