Avoid integer overflow in entropy counter.