There are many ways you can do this, for instance simply take the length of a single curve and define a total, desired length of the array, and divide the latter by the first. This will give you a decimal value, whose floor value will be the total number of curves to array.
The floor value guarantees that you never overshoot your maximum distance or length, however it doesn’t ensure that the resulting array length is equal to your desired length. This is only the case, if the decimal value is an integer.

Maybe instead of arraying curves, simply array balustrade modules.