You are given an array of non-negative integers $$$a_1$$$, $$$a_2$$$, ... $$$a_n$$$. Count number of triplets $$$1 \le i \lt j \lt k \le n$$$, such that $$$(a_i \oplus a_j) \lt (a_j \oplus a_k)$$$, where $$$\oplus$$$ is an exclusive OR (XOR) operation.
The first line contains a single integer $$$n$$$ — the number of elements in the array ($$$3 \le n \le 200\,000$$$).
The second line contains $$$n$$$ integer numbers $$$a_i$$$ — elements of the array ($$$0 \le a_i \le 10^{18}$$$).
Output single integer — the number of triplets.
| Subtask | Score | Constraints |
| $$$1$$$ | $$$17$$$ | $$$n \le 100$$$ |
| $$$2$$$ | $$$19$$$ | $$$n \le 3\,000$$$ |
| $$$3$$$ | $$$18$$$ | $$$n \le 30\,000$$$, $$$a_i \le 50$$$ |
| $$$4$$$ | $$$22$$$ | $$$n \le 30\,000$$$ |
| $$$5$$$ | $$$24$$$ | No additional constraints |
3 0 1 2
1
4 0 1 2 3
2
5 6 1 17 3 11
7
10 0 1 2 3 4 5 6 7 8 9
84
| Name |
|---|


