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

s = [int(x) for x in eval(input())]

l1 = [i % 2 for i in range(len(s))]

l2 = [1] + l1[:len(l1) - 1]

d1 = len([x for i, x in enumerate(s) if s[i] != l1[i]])

d2 = len([x for i, x in enumerate(s) if s[i] != l2[i]])

print((d1 if d1 < d2 else d2))
# -*- coding: utf-8 -*-

s = [int(x) for x in eval(input())]

l1 = [i % 2 for i in range(len(s))]

l2 = [1] + l1[:len(l1) - 1]

d1 = len([sv for sv, lv in zip(s, l1) if sv != lv])

d2 = len([sv for sv, lv in zip(s, l2) if sv != lv])

print((d1 if d1 < d2 else d2))

# -*- coding: utf-8 -*-
s = [int(x) for x in eval(input())]
l1 = [i % 2 for i in range(len(s))]
l2 = [1] + l1[: len(l1) - 1]
d1 = len([x for i, x in enumerate(s) if s[i] != l1[i]])
d2 = len([x for i, x in enumerate(s) if s[i] != l2[i]])
print((d1 if d1 < d2 else d2))

# -*- coding: utf-8 -*-
s = [int(x) for x in eval(input())]
l1 = [i % 2 for i in range(len(s))]
l2 = [1] + l1[: len(l1) - 1]
d1 = len([sv for sv, lv in zip(s, l1) if sv != lv])
d2 = len([sv for sv, lv in zip(s, l2) if sv != lv])
print((d1 if d1 < d2 else d2))

-d1 = len([x for i, x in enumerate(s) if s[i] != l1[i]]) -d2 = len([x for i, x in enumerate(s) if s[i] != l2[i]]) +d1 = len([sv for sv, lv in zip(s, l1) if sv != lv]) +d2 = len([sv for sv, lv in zip(s, l2) if sv != lv])