What is the simplest way to see how many classes of a certain type are in an array?

I have an array of Class Actors. I’m trying to count how many times a certain class shows up in this array. What’s the simplest way to do that? Filter seems to only work with Object based arrays.

The only way I’ve come up with is using a ForEach loop and increasing a variable by 1 each time it returns true on a comparison branch. I can do it this way, but it seems a bit complicated.