s = eval(input())

c = 0



for x in range(len(s)):

    c += 1 if s[x] != str(x%2) else 0



print((c if c < x+1-c else x+1-c))

s = eval(input())

c = 0

 

for x in range(len(s)):

    c += s[x] != ('0' if x%2 else '1')

 

print((c if c < x+1-c else x+1-c))

s = eval(input())
c = 0
for x in range(len(s)):
    c += 1 if s[x] != str(x % 2) else 0
print((c if c < x + 1 - c else x + 1 - c))

s = eval(input())
c = 0
for x in range(len(s)):
    c += s[x] != ("0" if x % 2 else "1")
print((c if c < x + 1 - c else x + 1 - c))

-    c += 1 if s[x] != str(x % 2) else 0 +    c += s[x] != ("0" if x % 2 else "1")