#C2023. Maximum Travelers

    ID: 45294 Type: Default 1000ms 256MiB

Maximum Travelers

Maximum Travelers

Given an array of stone values, determine the maximum number of travelers that can pass through the forest without stepping on stones of the same value. In other words, each traveler must step on stones with a unique value. Mathematically, if the list of stones is \( S = [s_1, s_2, \dots, s_n] \), the answer is \( |\{ s_1, s_2, \dots, s_n \}| \), the cardinality of the set of stone values.

The input begins with an integer n (the number of stones). The next line contains n space-separated integers representing the stone values. If n is 0, it indicates an empty list.

inputFormat

The first line of input contains a single integer n, representing the number of stones.

The second line contains n space-separated integers, each denoting a stone's value. For an empty list, n will be 0 and no further input is provided.

outputFormat

Output a single integer: the maximum number of travelers that can pass through the forest, which is equal to the number of unique stone values.

## sample
6
1 2 3 3 2 1
3