{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":" \n \u003cp\u003eGiven a binary string \u003cvar\u003eS\u003c/var\u003e, you can change one digit (from 0 to 1 or from 1 to 0) at a time. So what is the minimum number of changes needed to change \u003cvar\u003eS\u003c/var\u003e into an ordered binary string (every 0 is before the 1s) ? \u003c/p\u003e \n "}},{"title":"Input","value":{"format":"HTML","content":" \n \u003cp\u003eThe first line contains an integer \u003cvar\u003eT\u003c/var\u003e, the number of the test cases. (1 ≤ \u003cvar\u003eT\u003c/var\u003e ≤ 10)\u003c/p\u003e \n \u003cp\u003eThen follows \u003cvar\u003eT\u003c/var\u003e lines. Each line contains a binary string \u003cvar\u003eS\u003c/var\u003e. (1 ≤ |\u003cvar\u003eS\u003c/var\u003e| ≤ 1000)\u003c/p\u003e \n "}},{"title":"Output","value":{"format":"HTML","content":" \n \u003cp\u003eFor each test case output the answer. \u003c/p\u003e \n \u003c/div\u003e \n "}},{"title":"Sample Input","value":{"format":"HTML","content":" \n \u003cpre\u003e3\r\n000111\r\n010001\r\n100000 \u003c/pre\u003e \n "}},{"title":"Sample Output","value":{"format":"HTML","content":" \n \u003cpre\u003e0\r\n1\r\n1\u003c/pre\u003e \n "}}]}