Question about arrays and stuff with cx-programmer

So I am programming an Omron CP1E-N40DT-D plc and this is want I wanted to do:
I have a range of data memories that's assigned as an array, Slot[0] being D2000 to Slot[35] being D2035. Automatically assigned when I registered it to global symbols. Label name is Slot.

I wanted to be able to scan that range of Data memories if any of them is not equal to zero and count how many of them are and output the value to let's say D2100.
I know the long way would be comparing each DM one by one, but is there a shorter way of doing it?

I am new to using arrays here, and I am a bit stumped on how I should go about it.

Or am I wrong in my approach from the start?