s = eval(input())

n = len(s)

z0 = 0

z1 = 0

for i in range(n):

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

    z0 += 1

  else:

    z1 += 1

print((min(z0,z1)))
#14:35

s = eval(input())

n = len(s)

scr = 0

for i in range(n):

  a = int(s[i])

  if i == 0:

    b = 0

  else:

    b = 1 - b

  if a != b:

    scr += 1

#print(scr)

print((min(scr,n-scr)))
s = eval(input())
n = len(s)
z0 = 0
z1 = 0
for i in range(n):
    if int(s[i]) ^ (i % 2) == 0:
        z0 += 1
    else:
        z1 += 1
print((min(z0, z1)))

# 14:35
s = eval(input())
n = len(s)
scr = 0
for i in range(n):
    a = int(s[i])
    if i == 0:
        b = 0
    else:
        b = 1 - b
    if a != b:
        scr += 1
# print(scr)
print((min(scr, n - scr)))

+# 14:35 -z0 = 0 -z1 = 0 +scr = 0 -    if int(s[i]) ^ (i % 2) == 0: -        z0 += 1 +    a = int(s[i]) +    if i == 0: +        b = 0 -        z1 += 1 -print((min(z0, z1))) +        b = 1 - b +    if a != b: +        scr += 1 +# print(scr) +print((min(scr, n - scr)))