E is the total number of enemy armies and T is the total number of enemy territories as usual. The formula is:
F = E +4 - 2/3 T + 1/9 T + 1/27 T + ...
Any fractional value is rounded up. To explain the formula, note that with three dice versus two there are three possible results which are roughly equally likely, so the average expectation is both sides losing one man in one such battle. There will be E - T such battles on average, assuming the attacker always has enough men for three dice, which is why the factor 4 appears as the minimum to use three dice against one enemy. Then there will be roughly T battles with three dice against one for the remaining singleton armies. Roughly 2/3 of these the attacker wins, otherwise the attacker loses one man and has to repeat the battle. Then -T + 1/3 T is -2/3 T. The ellipsis is because of the repeated battles, going down by 1/3 each time.
Obviously, you only need the ellipsis terms for the larger battles. This is only roughly correct because the probabilities are slightly more in favour of the attacker with three v two dice, but that builds in a safety margin.