*s,=list(map(int,eval(input())))

t=s[::-1]

n=len(s)

a=b=0

for i in range(1,n):

    a+=s[i]==s[i-1]

    s[i]=1-s[i-1]

for i in range(1,n):

    b+=t[i]==t[i-1]

    t[i]=1-t[i-1]

print((min(a,b)))
*s,=list(map(int,eval(input())))

a=0

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

    a+=s[i]==s[i-1]

    s[i]=1-s[i-1]

print(a)
(*s,) = list(map(int, eval(input())))
t = s[::-1]
n = len(s)
a = b = 0
for i in range(1, n):
    a += s[i] == s[i - 1]
    s[i] = 1 - s[i - 1]
for i in range(1, n):
    b += t[i] == t[i - 1]
    t[i] = 1 - t[i - 1]
print((min(a, b)))

(*s,) = list(map(int, eval(input())))
a = 0
for i in range(1, len(s)):
    a += s[i] == s[i - 1]
    s[i] = 1 - s[i - 1]
print(a)

-t = s[::-1] -n = len(s) -a = b = 0 -for i in range(1, n): +a = 0 +for i in range(1, len(s)): -for i in range(1, n): -    b += t[i] == t[i - 1] -    t[i] = 1 - t[i - 1] -print((min(a, b))) +print(a)