#C5015. Sum of Unique Elements

    ID: 48618 Type: Default 1000ms 256MiB

Sum of Unique Elements

Sum of Unique Elements

Given an array of integers, your task is to compute the sum of elements which appear exactly once in the array. Formally, if the array is \(a_1, a_2, \dots, a_n\), you need to compute \(\sum_{a_i \text{ appears exactly once}} a_i\).

For example, if the input array is [1, 2, 3, 2, 1], the elements that appear only once are [3] and hence the answer is 3.

This problem is a part of the Taco subset of problems.

inputFormat

The first line contains a single integer \(n\) indicating the number of elements in the array. The second line contains \(n\) space-separated integers representing the elements of the array.

outputFormat

Output a single integer which is the sum of the elements that appear exactly once in the array.

## sample
5
1 2 3 2 1
3