_(In this problem statement, all sequences consist of non-negative integers.)_
There is a blackboard on which sequences are written. Initially, the blackboard only has one length-$N$ sequence $A=(A_1,A_2,\dots,A_N)$.
We repeat the following operation until all sequences on the blackboard are of length $1$:
* Among the sequences on the blackboard, choose one that has length at least $2$, and remove it from the blackboard. Let the chosen sequence be $B=(B_1,B_2,\dots,B_n)$. Then, choose an integer $k$ satisfying $1 \leq k < n$, and define $X = B_1 \oplus B_2 \oplus \dots \oplus B_k$ and $Y=B_{k+1} \oplus B_{k+2} \oplus \dots \oplus B_n$. Finally, write two sequences $(B_1 \oplus Y, B_2 \oplus Y,\dots,B_k \oplus Y)$ and $(B_{k+1} \oplus X,\ B_{k+2} \oplus X,\dots,B_n \oplus X)$ on the blackboard.
Here, $\oplus$ denotes the bitwise $\mathrm{XOR}$ operation.
After this series of operations, let $(C_1),(C_2),\dots,(C_N)$ be the $N$ sequences of length $1$ on the blackboard. Find the minimum possible value of $\sum_{i=1}^{N} C_i$.
Notes on the bitwise $\mathrm{XOR}$ operationFor two non-negative integers $A, B$, the bitwise $\mathrm{XOR}$ operation $A \oplus B$ is defined as follows.
* When $A \oplus B$ is written in binary, for each $2^k$ place ($k \geq 0$), the bit is 1 if and only if exactly one of the bits in the $2^k$ place of $A$ and $B$ (in binary) is 1, and 0 otherwise.
For example, $3 \oplus 5 = 6$ (in binary notation: $011 \oplus 101 = 110$).
In general, the bitwise $\mathrm{XOR}$ of $k$ non-negative integers $p_1, p_2, p_3, \dots, p_k$ is defined as $(\dots ((p_1 \oplus p_2) \oplus p_3) \oplus \dots \oplus p_k)$, and it can be proved that this value does not depend on the order of $p_1, p_2, \dots, p_k$.
## Constraints
* $1 \leq N \leq 500$
* $0 \leq A_i < 2^{40}$
* All input values are integers.
## Input
The input is given from Standard Input in the following format:
$N$
$A_1$ $A_2$ $\dots$ $A_N$
[samples]