# -*- coding: utf-8 -*-



ss = eval(input())

#print(ss)



s = []

for i in range(len(ss)):

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

#print(s)



if len(s)%2 == 0:

    s0 = [0,1] *(len(s)//2)

    s1 = [1,0] *(len(s)//2)

else:

    s0 = [0,1] *(len(s)//2)

    s0.append(0)

    s1 = [1,0] *(len(s)//2)

    s1.append(1)



#print(s0)

#print(s1)



sum0 = 0

sum1 = 0

for i in range(len(s)):

    

    if s0[i] != s[i]:

        #print(s0[i] , s[i])

        sum0 = sum0 +1



    if s1[i] != s[i]:

        #print(s1[i] , s[i])

        sum1 = sum1 +1



ans = min(sum0, sum1)

print(ans)

# -*- coding: utf-8 -*-

ss = eval(input())

*s, = list(map(int,ss))



if len(s)%2 == 0:

    s0 = [0,1] *(len(s)//2)

    s1 = [1,0] *(len(s)//2)

else:

    s0 = [0,1] *(len(s)//2)

    s0.append(0)

    s1 = [1,0] *(len(s)//2)

    s1.append(1)



sum0 = 0

sum1 = 0

for i in range(len(s)):   

    if s0[i] != s[i]:

        sum0 = sum0 +1

    if s1[i] != s[i]:

        sum1 = sum1 +1



ans = min(sum0, sum1)

print(ans)
# -*- coding: utf-8 -*-
ss = eval(input())
# print(ss)
s = []
for i in range(len(ss)):
    s.append(int(ss[i]))
# print(s)
if len(s) % 2 == 0:
    s0 = [0, 1] * (len(s) // 2)
    s1 = [1, 0] * (len(s) // 2)
else:
    s0 = [0, 1] * (len(s) // 2)
    s0.append(0)
    s1 = [1, 0] * (len(s) // 2)
    s1.append(1)
# print(s0)
# print(s1)
sum0 = 0
sum1 = 0
for i in range(len(s)):
    if s0[i] != s[i]:
        # print(s0[i] , s[i])
        sum0 = sum0 + 1
    if s1[i] != s[i]:
        # print(s1[i] , s[i])
        sum1 = sum1 + 1
ans = min(sum0, sum1)
print(ans)

# -*- coding: utf-8 -*-
ss = eval(input())
(*s,) = list(map(int, ss))
if len(s) % 2 == 0:
    s0 = [0, 1] * (len(s) // 2)
    s1 = [1, 0] * (len(s) // 2)
else:
    s0 = [0, 1] * (len(s) // 2)
    s0.append(0)
    s1 = [1, 0] * (len(s) // 2)
    s1.append(1)
sum0 = 0
sum1 = 0
for i in range(len(s)):
    if s0[i] != s[i]:
        sum0 = sum0 + 1
    if s1[i] != s[i]:
        sum1 = sum1 + 1
ans = min(sum0, sum1)
print(ans)

-# print(ss) -s = [] -for i in range(len(ss)): -    s.append(int(ss[i])) -# print(s) +(*s,) = list(map(int, ss)) -# print(s0) -# print(s1) -        # print(s0[i] , s[i]) -        # print(s1[i] , s[i])