Tiles=eval(input())



N_len=len(Tiles)



type1 = 0



# １スタート

for i in range(N_len):

    if Tiles[i] == str(i%2):

        type1 += 1

        

# 0スタート

type2=0

for i in range(N_len):

    if Tiles[i] != str(i%2):

        type2 += 1

        

print((min(type1,type2)))
Tiles=eval(input())



N_len=len(Tiles)

type1 = sum( 1 if Tiles[i] == str(i%2) else 0 for i in range(N_len))

type2 = sum( 0 if Tiles[i] == str(i%2) else 1 for i in range(N_len))

print((min(type1,type2)))
Tiles = eval(input())
N_len = len(Tiles)
type1 = 0
# １スタート
for i in range(N_len):
    if Tiles[i] == str(i % 2):
        type1 += 1
# 0スタート
type2 = 0
for i in range(N_len):
    if Tiles[i] != str(i % 2):
        type2 += 1
print((min(type1, type2)))

Tiles = eval(input())
N_len = len(Tiles)
type1 = sum(1 if Tiles[i] == str(i % 2) else 0 for i in range(N_len))
type2 = sum(0 if Tiles[i] == str(i % 2) else 1 for i in range(N_len))
print((min(type1, type2)))

-type1 = 0 -# １スタート -for i in range(N_len): -    if Tiles[i] == str(i % 2): -        type1 += 1 -# 0スタート -type2 = 0 -for i in range(N_len): -    if Tiles[i] != str(i % 2): -        type2 += 1 +type1 = sum(1 if Tiles[i] == str(i % 2) else 0 for i in range(N_len)) +type2 = sum(0 if Tiles[i] == str(i % 2) else 1 for i in range(N_len))