a=0

for i,s in enumerate(eval(input())):a+=i%2^int(s)

print((min(a,i-a+1)))
import sys

s=sys.stdin.buffer.readline().rstrip()

n=len(s)

a=0

for i in range(n):

    a+=s[i]%2==i%2

print((min(a,n-a)))
a = 0
for i, s in enumerate(eval(input())):
    a += i % 2 ^ int(s)
print((min(a, i - a + 1)))

import sys

s = sys.stdin.buffer.readline().rstrip()
n = len(s)
a = 0
for i in range(n):
    a += s[i] % 2 == i % 2
print((min(a, n - a)))

+import sys + +s = sys.stdin.buffer.readline().rstrip() +n = len(s) -for i, s in enumerate(eval(input())): -    a += i % 2 ^ int(s) -print((min(a, i - a + 1))) +for i in range(n): +    a += s[i] % 2 == i % 2 +print((min(a, n - a)))