Zero String
You are given a binary string of length . You are allowed to perform the following types of operations on string :
Delete any one character from , and concatenate the remaining parts of the string. For example, if we delete the third character of , it becomes ;
Flip all the characters of . For example, if we flip all character of , it becomes .
Given that you can use either type of operation any number of times, find the minimum number of operations required to make all characters of the string equal to .
Input
The first line contains a single integer , denoting the number of test cases. Each test case consists of multiple lines.
The first line of each test case contains an integer ) — the length of the string. The next line contains a binary string of length .
It is known that contains and only.
Output
For each test case, output on a new line, the minimum number of operations required to make all characters of the string equal to .