s=eval(input())

x=[i%2 for i in range(len(s))]

y=[~i%2 for i in range(len(s))]

#print(x,y)

c=0

e=0

for i in range(len(s)):

    #print(s[i],x[i],y[i])

    if int(s[i])!=x[i]:

        c+=1

    if int(s[i])!=y[i]:

        e+=1

print((min(c,e)))
s=eval(input())

ans=0

ans2=0

for i in range(len(s)):

    if int(s[i])!=i%2:

        ans+=1

    if int(s[i])!=(i+1)%2:

        ans2+=1

print((min(ans,ans2)))
s = eval(input())
x = [i % 2 for i in range(len(s))]
y = [~i % 2 for i in range(len(s))]
# print(x,y)
c = 0
e = 0
for i in range(len(s)):
    # print(s[i],x[i],y[i])
    if int(s[i]) != x[i]:
        c += 1
    if int(s[i]) != y[i]:
        e += 1
print((min(c, e)))

s = eval(input())
ans = 0
ans2 = 0
for i in range(len(s)):
    if int(s[i]) != i % 2:
        ans += 1
    if int(s[i]) != (i + 1) % 2:
        ans2 += 1
print((min(ans, ans2)))

-x = [i % 2 for i in range(len(s))] -y = [~i % 2 for i in range(len(s))] -# print(x,y) -c = 0 -e = 0 +ans = 0 +ans2 = 0 -    # print(s[i],x[i],y[i]) -    if int(s[i]) != x[i]: -        c += 1 -    if int(s[i]) != y[i]: -        e += 1 -print((min(c, e))) +    if int(s[i]) != i % 2: +        ans += 1 +    if int(s[i]) != (i + 1) % 2: +        ans2 += 1 +print((min(ans, ans2)))