Count how many times each beat value is collected and compute the total number of distinct beat values.
You are collecting beats over time. Each beat is represented by an integer value. Your task is to process the sequence and determine how many times each value appears, or any other simple aggregate requested by the exact problem variant.
For this record, the intended core task is a straightforward implementation-style counting problem: read the input sequence and compute the required summary directly without advanced data structures.
The first line contains an integer . The second line contains integers.
Output the required summary for the sequence.
Use a linear scan and simple counting/aggregation. Values fit in 32-bit signed integers.
Example 1
Input
5 1 2 1 3 2
Output
3
Explanation
There are 3 distinct values in the sequence: 1, 2, and 3.
Premium problem context
Premium adds guided hints, editorial links, similar variants, discussion resources, and concept maps so you can understand why a problem matters, not just solve it once.