I'm a little shocked you wrote this. Historically leaders made and make mistakes all the time. I think Russia exactly didn't do the math, that is the exact problem. Witness that attack on Kiev that collapsed in humiliation, the battle of Hostomel Airport, the non-establishment of air or sea superiority, the failed attempts to assassinate Zelensky, sanctions by many countries, the war ongoing after well over a year and actually being pushed back and attacks behind the front lines in Russian territory, all the generals killed... I don't think any of that was in the Putin's "math".