s = eval(input())

c1,c2 = 0, 0



for x in range(len(s)):

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

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



print((min(c1,c2)))

s = eval(input())

c = 0



for x in range(len(s)):

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



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

s = eval(input())
c1, c2 = 0, 0
for x in range(len(s)):
    c1 += 1 if s[x] != ("0" if x % 2 else "1") else 0
    c2 += 1 if s[x] != ("1" if x % 2 else "0") else 0
print((min(c1, c2)))

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

-c1, c2 = 0, 0 +c = 0 -    c1 += 1 if s[x] != ("0" if x % 2 else "1") else 0 -    c2 += 1 if s[x] != ("1" if x % 2 else "0") else 0 -print((min(c1, c2))) +    c += 1 if s[x] != ("0" if x % 2 else "1") else 0 +print((c if c < x + 1 - c else x + 1 - c))