Anselm has a passage in Why God Became Man where he considers whether the number of elect humans makes up for the number of fallen angels. After all, he assumes, there is a definite number.
Why should he?
Well, God either made an infinite number of creatures or a finite number of creatures. It may be that God did make an infinite number or creatures, but it strikes me as highly improbable, and in fact absurd. I am not sure that I can demonstrate that there is not a finite number of creatures, since it seems to me that you don’t require space for an infinite number of spiritual beings. Still, how likely is it that this should happen? And I’m inclined to believe that all you need is boundaries; which in terms of the spiritual realm, is a definition, as Eriugena teaches. God has many creatures, but surely these are not infinite in number, but finite, since they are part of creation which is limited. God alone is infinite.
If, however, it can be demonstrated or it is revealed that God made an infinite number of angels, then it is illogical to assume that he would need to replace any of them when some fell. You can’t diminish infinity by subtraction.
But let us say it really is absurd to believe that there are an infinite number of angelic beings, which seems by far more probable, and assume instead there is a finite number. What kind of God does not have a reason for that number? Only an arbitrary God would make a random number of angelic beings, and that is not what we ought to think about God. God is not arbitrary; God has intelligence and purpose, and when God makes a number of anything, though we may not understand it, you can be sure there is a reason for it: that is how God does things because that is what God is like.
So, then, if you have a finite number of angels, and some of them fall, you no longer have that original finite number. You have a diminished finite number. If that number had a reason, then that is a reason to replace them. So it is not so far-fetched, it seems to me, for Anselm to assume, as Augustine did before him, that perhaps the number of the elect in some way corresponds to the unknown number of the fallen angels, replacing in that City those who diminished the original supply.