import copy

s = list(eval(input()))

c = copy.copy(s)

n = len(s)

cnt1 = cnt2 = 0

for i in range(n-1):

    if c[i+1]==c[i]:

        cnt1 += 1

        c[i+1] = '0' if c[i+1]=='1' else '1'

s[0] = '0' if s[0]=='1' else '1'

cnt2+=1

for i in range(1,n):

    if s[i-1]==s[i]:

        cnt2 += 1

        s[i] = '0' if s[i]=='1' else '1'

print((min(cnt1,cnt2)))
s = eval(input())

a1 = a2 = 0

for i in range(len(s)):

    if i%2==0:

        if s[i]=='1':a1+=1

        else:a2+=1

    else:

        if s[i]=='0':a1+=1

        else:a2+=1

print((min(a1,a2)))
import copy

s = list(eval(input()))
c = copy.copy(s)
n = len(s)
cnt1 = cnt2 = 0
for i in range(n - 1):
    if c[i + 1] == c[i]:
        cnt1 += 1
        c[i + 1] = "0" if c[i + 1] == "1" else "1"
s[0] = "0" if s[0] == "1" else "1"
cnt2 += 1
for i in range(1, n):
    if s[i - 1] == s[i]:
        cnt2 += 1
        s[i] = "0" if s[i] == "1" else "1"
print((min(cnt1, cnt2)))

s = eval(input())
a1 = a2 = 0
for i in range(len(s)):
    if i % 2 == 0:
        if s[i] == "1":
            a1 += 1
        else:
            a2 += 1
    else:
        if s[i] == "0":
            a1 += 1
        else:
            a2 += 1
print((min(a1, a2)))

-import copy - -s = list(eval(input())) -c = copy.copy(s) -n = len(s) -cnt1 = cnt2 = 0 -for i in range(n - 1): -    if c[i + 1] == c[i]: -        cnt1 += 1 -        c[i + 1] = "0" if c[i + 1] == "1" else "1" -s[0] = "0" if s[0] == "1" else "1" -cnt2 += 1 -for i in range(1, n): -    if s[i - 1] == s[i]: -        cnt2 += 1 -        s[i] = "0" if s[i] == "1" else "1" -print((min(cnt1, cnt2))) +s = eval(input()) +a1 = a2 = 0 +for i in range(len(s)): +    if i % 2 == 0: +        if s[i] == "1": +            a1 += 1 +        else: +            a2 += 1 +    else: +        if s[i] == "0": +            a1 += 1 +        else: +            a2 += 1 +print((min(a1, a2)))