s = list(str(eval(input())))

S = []

for i in range(len(s)):

  S.append(int(s[i]))

ans1 = 100000

ans2 = 100000

ans = 0

t = 0

s = 0



if S[0]==0:

  for i in range(1,len(S),2):

    if S[i] != 1:

      t += 1

  for i in range(0,len(S),2):

    if S[i] != 0:

      s += 1

  ans1 = min(t+s,len(S)-t-s)

else:

  for i in range(1,len(S),2):

    if S[i] != 0:

      t += 1

  for i in range(0,len(S),2):

    if S[i] != 1:

      s += 1

  ans2 = min(t+s,len(S)-t-s) 

ans=min(ans1,ans2)

print(ans)

S = eval(input())

len_S = len(S)

cnt1 = 0



if len_S%2 == 0:

  ans = "01"*(len_S//2)

else:

  ans = "01"*(len_S//2)+"0"

for i in range(len_S):

  if S[i]!=ans[i]:

    cnt1 += 1

final_ans = min(len_S-cnt1,cnt1)

print(final_ans)
s = list(str(eval(input())))
S = []
for i in range(len(s)):
    S.append(int(s[i]))
ans1 = 100000
ans2 = 100000
ans = 0
t = 0
s = 0
if S[0] == 0:
    for i in range(1, len(S), 2):
        if S[i] != 1:
            t += 1
    for i in range(0, len(S), 2):
        if S[i] != 0:
            s += 1
    ans1 = min(t + s, len(S) - t - s)
else:
    for i in range(1, len(S), 2):
        if S[i] != 0:
            t += 1
    for i in range(0, len(S), 2):
        if S[i] != 1:
            s += 1
    ans2 = min(t + s, len(S) - t - s)
ans = min(ans1, ans2)
print(ans)

S = eval(input())
len_S = len(S)
cnt1 = 0
if len_S % 2 == 0:
    ans = "01" * (len_S // 2)
else:
    ans = "01" * (len_S // 2) + "0"
for i in range(len_S):
    if S[i] != ans[i]:
        cnt1 += 1
final_ans = min(len_S - cnt1, cnt1)
print(final_ans)

-s = list(str(eval(input()))) -S = [] -for i in range(len(s)): -    S.append(int(s[i])) -ans1 = 100000 -ans2 = 100000 -ans = 0 -t = 0 -s = 0 -if S[0] == 0: -    for i in range(1, len(S), 2): -        if S[i] != 1: -            t += 1 -    for i in range(0, len(S), 2): -        if S[i] != 0: -            s += 1 -    ans1 = min(t + s, len(S) - t - s) +S = eval(input()) +len_S = len(S) +cnt1 = 0 +if len_S % 2 == 0: +    ans = "01" * (len_S // 2) -    for i in range(1, len(S), 2): -        if S[i] != 0: -            t += 1 -    for i in range(0, len(S), 2): -        if S[i] != 1: -            s += 1 -    ans2 = min(t + s, len(S) - t - s) -ans = min(ans1, ans2) -print(ans) +    ans = "01" * (len_S // 2) + "0" +for i in range(len_S): +    if S[i] != ans[i]: +        cnt1 += 1 +final_ans = min(len_S - cnt1, cnt1) +print(final_ans)