The coinbase rewards aren't theoretical. You CAN use a simple multiplication here.
Otherwise, I'm afraid I either don't know what you mean, or I don't have enough knowledge...sorry.
Actually you can't due to a small oversight in the protocol (or at least what I consider an oversight).
A block is valid if the coinbase reward is not more than the current subsidy plus transaction fees. A block is valid if it is less than the max allowed reward and when that happens coins are lost and the supply is slightly less than the theoretical limit. Miners have in the past (probably due to errors) have created coinbase transactions which payout less than the max allowed. The two most common scenarios are a block which has a coinbase reward of zero and a block which has a coinbase reward equal to the subsidy when there are tx fees in the block (i.e. 25.0 BTC vs 25.00128 BTC). Doing a computation based on block height will slightly overestimate the number of available coins.
To answer the OP the only way to get an exact count would involve parsing every block. Start at the genesis block and set a coin counter at zero. For each block compute the amount of the transaction fees in the block. Subtract the fees from the coinbase amount and the difference is the number of newly mined coins. Add this to a coin counter and move to the next block. Repeat until you reach the current block. To be robust you may want to record the supply at all or some block heights. In the event of a reorg you would need to return to that last known height prior to the reorg and recompute (differences due to reduced rewards are less likely now but not impossible).
You will also need to decide how to handle the genesis block. There is a 50 BTC reward but the protocol currently doesn't allow them to be spent. It is unlikely that will ever change. In my opinion that means it isn't part of the coin supply. To improve your reported supply further you could subtract out all known provably lost coins and maybe ones which can be said to be unspenable with a high degree of confidence (i.e. coins sent to an address where the pubkeyhash is 1111111111111111111111111111111111111111111111111111 as the odds that by chance or design someone generated a pubkey which hashes to all zeroes is essentially zero.
So there are at least 4 potential supplies
1) theoretical supply (based on block height and subsidy calculations)
2) generated supply (based on blockchain and actual minting rewards)
3) provable maximal supply (based on #2 minus all provable lost coins after minting)
4) probable maximal supply (based on #3 minus all coins which have a high confidence of being lost)
Obviously each supply is slightly smaller than the one before it. The difference is pretty small though (and very likely to diminish as % over time). The last time I looked the difference between #1 and #4 was less than 0.5%.