For every unordered pair of elements in the array, compute the Hamming distance (the number of differing bits) and output the sum over all pairs.
Input format
Line 1: an integer n.
Line 2: n space-separated non-negative integers (present whenever n >= 1).
Output format
One line: the total Hamming distance over all pairs.
Constraints
- 1 <= n <= 100000
- 0 <= each value <= 1000000000