Given an array of N integers you have to calculate the value of sum of count[x]∗x where x represents the distinct elements of the array and count[x]is the number of times x occurs in the array.
Input
First line contains an integer n.
Second line contains an array of n integers where n<100000.
Output
A single integer denoting the answer.
The answer is: count(2) * 2 +count(1) * 1 = 5.
Constraints:
1 ≤ A[i],N ≤ 100000