You are given a string $s$. Each character is either 0 or 1.

You want all 1's in the string to form a contiguous subsegment. For example, if the string is 0, 1, 00111 or 01111100, then all 1's form a contiguous subsegment, and if the string is 0101, 100001 or 11111111111101, then this condition is not met.

You may erase some (possibly none) 0's from the string. What is the minimum number of 0's that you have to erase?


-----Input-----

The first line contains one integer $t$ ($1 \le t \le 100$) — the number of test cases.

Then $t$ lines follow, each representing a test case. Each line contains one string $s$ ($1 \le |s| \le 100$); each character of $s$ is either 0 or 1.


-----Output-----

Print $t$ integers, where the $i$-th integer is the answer to the $i$-th testcase (the minimum number of 0's that you have to erase from $s$).


-----Example-----
Input
3
010011
0
1111000

Output
2
0
0



-----Note-----

In the first test case you have to delete the third and forth symbols from string 010011 (it turns into 0111).

Difficulty: interview

Starter code:

Solutions:
t = int(input())
for _ in range(t):
    s = input().strip('0')
    print(s.count('0'))



for i in range(int(input())):
    q=input()
    if '1' in q:print(q.rfind('1')-q.find('1')-q.count('1')+1)
    else:print(0)

import collections, heapq

def main():    
    T = int(input().strip())

    for _ in range(T):
        s = input().strip("0")
        print(s.count("0"))
    

main()

for _ in  range(int(input())):
    word = input()
    temp = []
    for i in range(len(word)):
        if word[i]=='1':
            temp.append(i)
    ans = 0
    for i in range(1,len(temp)):
        ans+=(temp[i]-temp[i-1]-1)
    print(ans)

t=int(input())
while t:
    s=input()
    ls=[]
    for i in range(len(s)):
        if(s[i]=="1"):
            ls.append(i)
    if(len(ls)==0):print(0)
    else:
        count=0
        for i in range(ls[0],ls[-1]):
            if(s[i]=="0"):
                count+=1
        print(count)
    t-=1    

for _ in range(int(input())):
    s = input()
    print(s[s.find('1'):s.rfind('1')].count('0'))



def main():
	q = int(input())

	for _ in range(q):
		s = input()
		o = False
		inc = 0
		i = 0
		for x in range(len(s)):
			if s[x] == '1':
				i = x
		for x in range(len(s)):
			if s[x] == '0' and o == True and x < i:
				inc += 1
			if s[x] == '1':
				o = True
		print(inc)

main()
    


for _ in range(int(input())):
    s = input()
    if '1' not in s:
        print(0)
    else:
        print(s.rindex('1') - s.index('1') - s.count('1') + 1)


N = int(input())
for _ in range(N):
    s = input()
    first = -1
    last = -1
    for i in range(len(s)):
        if s[i] == '1':
            if first == -1:
                first = i
            last = i
    cnt = 0
    if first == -1:
        print(0)
        continue
    for i in range(first, last + 1):
        if s[i] == '0':
            cnt += 1
    print(cnt)


t=int(input())
while(t):
        t-=1
        s=input()
        s=s.rstrip('0')
        s=s[-1::-1]
        s=s.rstrip('0')
        s=s[-1::-1]
        c=0
        l=len(s)
        print(s.count('0'))
        


for _ in range(int(input())):
    s = input()
    res = s.count('0')
    i = 0
    while i < len(s) and s[i] == '0':
        res -= 1
        i += 1
    j = len(s) - 1
    while j > i and s[j] == '0':
        res -= 1
        j -= 1
    print(res)


for i in range(int(input())):
    s=input()
    k=-1
    ans=0
    for i in range(len(s)):
        if s[i]=='1':
            if k==-1:
                k=i
            else:
                ans+=i-k-1
                k=i
    print(ans)