s=list(eval(input()))

s=[int(s[i]) for i in range(len(s))]

tile=s[0]

cnt=0

for i in range(1,len(s)):

    if s[i]==tile:

        cnt+=1

    if tile==1:

        tile=0

    else:

        tile=1

print(cnt)
s=list(eval(input()))

a=["0","1"]

cnt=0

for i in range(len(s)):

    if s[i]!=a[i%2]:

        cnt+=1

print((min(cnt,len(s)-cnt)))
s = list(eval(input()))
s = [int(s[i]) for i in range(len(s))]
tile = s[0]
cnt = 0
for i in range(1, len(s)):
    if s[i] == tile:
        cnt += 1
    if tile == 1:
        tile = 0
    else:
        tile = 1
print(cnt)

s = list(eval(input()))
a = ["0", "1"]
cnt = 0
for i in range(len(s)):
    if s[i] != a[i % 2]:
        cnt += 1
print((min(cnt, len(s) - cnt)))

-s = [int(s[i]) for i in range(len(s))] -tile = s[0] +a = ["0", "1"] -for i in range(1, len(s)): -    if s[i] == tile: +for i in range(len(s)): +    if s[i] != a[i % 2]: -    if tile == 1: -        tile = 0 -    else: -        tile = 1 -print(cnt) +print((min(cnt, len(s) - cnt)))