[1, 1, 2, 3, 3, 3, 7, 7, 7, 7 etc..] stored in var1. How can I count the occurrences of 1, 2, 3, and 7 in this array in Copilot Studio, considering that the numbers may vary and change dynamically?

[1, 1, 2, 3, 3, 3, 7, 7, 7, 7 etc..] stored in var1. How can I count the occurrences of 1, 2, 3, and 7 in this array in Copilot Studio, considering that the numbers may vary and change dynamically?