Distance mate equation

Hi, I want to add an equation to update a distance mate basedon the number of instances a component is patterned in my assembly.

Basically I have two end pieces and variable quantities of 48mmwide middle sections. I want the ends to be at the end regardlessof the number of middle sections.

I expect this can be done with an assembly design table? What isthe variable for "Number of instances" in a component pattern?
I would hope it could be as simple as "D1@Distance1" =48*"Instances@Pattern1" but without knowing the variable name forquantity in a pattern it wouldn't work.

Thanks.SolidworksAssemblies