You are developing a program for a toy slot machine game. The program implementation takes a line as input and converts each string to a particular toy class, the _ character indicating no won toy. The parsing is already written, and, as a result, we have a list of None or Some with an instance of a particular toy. Since there are too many toy classes, they disobey the general hierarchy, AnyRef was used.
Implement a function that can count their number without knowing the type of each toy.