You are given a tree consisting of N nodes, where the ith node has a value Ai assigned to it.
You can do the following operation any number of times. In an operation, you can :
Find the minimum number of operations to be performed so that the bitwise AND of the values present in any two adjacent nodes of the tree is zero.
Input format
Output format
For each query, print the minimum number of operations to be performed so that the bitwise AND of the values present in any two adjacent nodes of the tree is zero.
Constraints
2≤N≤1051≤Ai≤1031≤Xi<Yi≤N
One possible sequence of operations is: Apply the operation on the node 1 twice making A1=0, node 3 once making A3=2, node 6 once making A6=1.