With Looping
1. Loop through the values.
2. Take a dictionary or key value pair representation.
3. Check if the value is already present in the dictionary by comparing it with the key.
4. If not present, then add the value (1/2/3) as a Key and count as the Value.
4. Increment count inside the loop.
LINQ
Use distinct count, like it is described here -
C# LINQ counting elements with DISTINCT[
^].