You are given a binary array (array consists of 0′s and 1′s) A that contains N elements. You can perform the following operation as many time as you like:
Your task is to transform the given array into a special array that for every index 1≤i<N, Ai∧Ai+1=1.
Here, ∧ denotes XOR.
Input format
Output format
For each test case, print one line denoting the minimum cost to transform array A into a special array.
Constraints
1≤T≤100
1≤N≤10000
0≤A[i]≤1∀i∈[1,N]
1≤C01,C10≤1e9
In first test case we can convert first 1 to 0 costing 1 coin.
In second test it is already special.