how to increment local variable in for each loop in appian expression rule?

i written code : 

with(
local!prioritylist:{1,2,3,4,5,6,7,8,9,10},
local!missinglist{}:{},
local!newmissing,
local!count:0,
local!temp: a!forEach(
items:local!prioritylist,
expression:
if(fv!item <ri!priority,if(rule!CRP_Checkdepartmentwisepriority(fv!item,ri!department)=0,append(local!missinglist{},fv!item),local!missinglist{}),local!missinglist{}),

local!newmissing:if(count(local!missinglist{})>0,count(local!missinglist{}),local!newmissing)
),


local!temp

)

i got the output like this:

List of Variant - 10 items

    • List of Variant - 0 items
      • List of Variant - 0 items
        • List of Number (Integer) - 1 item
            • 3(Number (Integer))
            • List of Variant - 0 items
              • List of Variant - 0 items
                • List of Variant - 0 items
                  • List of Variant - 0 items
                    • List of Variant - 0 items
                      • List of Variant - 0 items
                        • List of Variant - 0 items

                        Here i want sum of count of each list of this list . Answer should be 1

                        So, How to add the count of each list in one variable??

                          Discussion posts and replies are publicly visible