#C2437. Sum of Singletons

    ID: 45753 Type: Default 1000ms 256MiB

Sum of Singletons

Sum of Singletons

Given a list of integers, your task is to compute the sum of all singleton values. A singleton value is defined as a value that appears exactly once in the list.

You are required to read the input from stdin and output the result to stdout.

The problem can be mathematically described as: Given a list \( A = [a_1, a_2, \dots, a_n] \), compute the sum \( S = \sum_{a \in A, \, count(a)=1} a \).

inputFormat

The first line of input contains an integer \( n \) indicating the number of elements in the list. The second line contains \( n \) space-separated integers.

outputFormat

Output a single integer representing the sum of all singleton values in the list.

## sample
6
4 5 7 5 4 8
15