It has long been calculated and published, and in several variations.
Let's say you took a secondary town or killed a computer-controlled hero, built dwarves, and got 8 of them. Many bought them and turned them into demons, but it would be better to buy 7, which would yield 4 demons with 140 hit points. If, in the next week, a new castle and a miners' guild are built in it, there will be 20 + 1 dwarf = 12 demons, so not a single hit point is lost. But if we had turned 8 dwarves into demons first and then 20, we would have gotten fewer demons. The same can be said for swamp lizards, which should be turned into demons in groups of 5, 10, or 20, 25, to avoid losing hit points. Snakes with 20 hit points and pegasi with 30. If you take 2 secondary towns, Rampart and Swamp, you can lose a lot of demons for no reason in just 2 weeks (I haven't calculated it yet)