You are given a binary string S of length N. You can apply the following operation to the string S :
Find the minimum number of operations required to sort the given string S. It is always possible to sort any string under the given constraints.
Input format
Output format
For each test case, print the minimum number of operations required to sort the given string S.
Constraints
1≤T≤1051≤N≤3⋅105Scontains′0′sand′1′s.SumofNoveralltestcasesdoesnotexceed3⋅105.
In the first test case, choose i=1,j=3 and flip S1,S3 making S=111 which is a sorted string.
In the second test case, choose i=1,j=2 and flip S1,S3 making S=000100, then choose i=5,j=6 and flip S5,S6 making S=000111, which is a sorted string.