Calculate the count directly.

And actually there's a better way to build up a string in a loop. We can
talk.