As a followup on my previous post:
The response from CollectionLength is a string value, and this will cause problems when you need to perform calculations with the number.
The solution to this problem is JScript. What not many people know is that the expression between @@<code>@@ or ${<code>} is evaluated as JScript, and this will allow you to use methods like parseInt:
@@parseInt(${CollectionLength("[multi-value field name]")})@@