Given a set $$$A$$$ of $$$n$$$ non-negative integers, we define its AND-OR closure as the $$$B$$$ with smallest size such that:
Find the size of the AND-OR closure of $$$A$$$.
Here AND denotes the bitwise AND operation, and OR denotes the bitwise OR operation.
The first line of the input contains a single integer $$$n$$$ ($$$1 \leq n \leq 2 \cdot 10^5$$$) — the size of the set $$$A$$$.
The second line contains $$$n$$$ distinct integers $$$a_1$$$, $$$a_2$$$, $$$\ldots$$$ , $$$a_n$$$ ($$$0\leq a_i \lt 2^{40}$$$) — which represent the elements of $$$A$$$.
Print the size of the AND-OR closure of $$$A$$$.
40 1 3 5
5
50 1 2 3 4
8
In the first sample, the AND-OR closure of $$$A$$$ is $$$\{0, 1, 3, 5, 7\}$$$.
In the second sample, the AND-OR closure of $$$A$$$ is $$$\{0, 1, 2, 3, 4, 5, 6, 7\}$$$.
| Name |
|---|


