*s,=list(map(int,eval(input())));a=0

for i in range(1,len(s)):a+=s[i]==s[i-1];s[i]=1-s[i-1]

print(a)
a=0

for i,s in enumerate(eval(input())):a+=i%2^int(s)

print((min(a,i-a+1)))
(*s,) = list(map(int, eval(input())))
a = 0
for i in range(1, len(s)):
    a += s[i] == s[i - 1]
    s[i] = 1 - s[i - 1]
print(a)

a = 0
for i, s in enumerate(eval(input())):
    a += i % 2 ^ int(s)
print((min(a, i - a + 1)))

-(*s,) = list(map(int, eval(input()))) -for i in range(1, len(s)): -    a += s[i] == s[i - 1] -    s[i] = 1 - s[i - 1] -print(a) +for i, s in enumerate(eval(input())): +    a += i % 2 ^ int(s) +print((min(a, i - a + 1)))