#K88557. Count Distinct Product Identifiers

    ID: 37334 Type: Default 1000ms 256MiB

Count Distinct Product Identifiers

Count Distinct Product Identifiers

You are given a list of product identifiers. Your task is to determine the number of unique (distinct) product identifiers in the list. In mathematical terms, if the list is represented as \(a_1, a_2, \dots, a_n\), you need to compute the value of \(|\{a_1, a_2, \dots, a_n\}|\), where \(|\cdot|\) denotes the cardinality of a set.

Example:

If the input list is [1001, 1002, 1002, 1003, 1001], then the distinct identifiers are {1001, 1002, 1003}, and the output should be 3.

inputFormat

The input is given via standard input (stdin) and consists of two lines. The first line contains an integer \(n\) (\(0 \leq n \leq 10^5\)) representing the number of product identifiers. The second line contains \(n\) space-separated integers, each representing a product identifier.

outputFormat

Output a single integer to standard output (stdout) – the number of distinct product identifiers in the list.

## sample
5
1001 1002 1002 1003 1001
3