Basically, you want something like this:
![Image](https://forums.factorio.com/images/ext/abd7303967897b59ff68e9029992c609.jpg)
The idea is that you somehow divide each item's signal by the corresponding stack size, but I can't think of a way to make that work.
An alternative would be to have a bunch of arithmetics each with a different inbuilt stack size, problem is the amount of them (would need 7 since there are 8 different stack sizes - 1, 5, 10, 20, 50, 100, 200, 2000) and some kind of signal filter to get each item to a corresponding stack divider arithmetic. No idea how I'd do that either.