#C10912. Count Unique Elements
Count Unique Elements
Count Unique Elements
Given a list of integers, your task is to count the number of unique elements. Formally, let \( S \) be the set obtained from the list of integers. You are required to output \(|S|\), the cardinality of \( S \).
For example, if the input is 1 2 3 4 5
, then the number of unique elements is 5
, whereas if the input is 1 1 1 1 1
then the answer is 1
.
The input will be provided via stdin and the output should be printed to stdout.
inputFormat
The input consists of two lines:
- The first line contains a single integer \( n \) (\(1 \leq n \leq 10^5\)), which is the number of elements in the list.
- The second line contains \( n \) space-separated integers.
outputFormat
Output a single integer denoting the number of unique elements in the list.
## sample5
1 2 3 4 5
5