#C4141. Sum of Unique Integers

    ID: 47647 Type: Default 1000ms 256MiB

Sum of Unique Integers

Sum of Unique Integers

You are given an integer n and a list of n integers. Your task is to remove all duplicate values from the list and compute the sum of the unique integers.

In mathematical terms, let \(S = \{a_1, a_2, \dots, a_n\}\). Define \(U\) as the set of unique elements in \(S\), i.e. \(U = \{x : x \in S\}\). The answer is then given by:

\[ \text{answer} = \sum_{x \in U} x \]

Read the input from standard input and write the result to standard output.

inputFormat

The first line contains an integer n, representing the number of integers in the list. The second line contains n space-separated integers.

outputFormat

Output a single integer, which is the sum of the unique integers in the list.

## sample
5
3 1 2 2 3
6