import math

import sys



def main():

    s = eval(input())

    a = [(ch) for ch in s]



    ans = 0



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

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

            ans += 1

            a[i] = ('1' if a[i] == '0' else '0')



    print(ans)



if __name__ == '__main__':

    sys.exit(main())
string = eval(input())

predicted_value = 0

last_colour = bool(int(string[0]))

for s in string[1:]:

    was_white = bool(int(s))

    if last_colour == was_white:

        predicted_value += 1

        last_colour = not was_white

    else:

        last_colour = was_white

print(predicted_value)
import math
import sys


def main():
    s = eval(input())
    a = [(ch) for ch in s]
    ans = 0
    for i in range(1, len(a)):
        if a[i] == a[i - 1]:
            ans += 1
            a[i] = "1" if a[i] == "0" else "0"
    print(ans)


if __name__ == "__main__":
    sys.exit(main())

string = eval(input())
predicted_value = 0
last_colour = bool(int(string[0]))
for s in string[1:]:
    was_white = bool(int(s))
    if last_colour == was_white:
        predicted_value += 1
        last_colour = not was_white
    else:
        last_colour = was_white
print(predicted_value)

-import math -import sys - - -def main(): -    s = eval(input()) -    a = [(ch) for ch in s] -    ans = 0 -    for i in range(1, len(a)): -        if a[i] == a[i - 1]: -            ans += 1 -            a[i] = "1" if a[i] == "0" else "0" -    print(ans) - - -if __name__ == "__main__": -    sys.exit(main()) +string = eval(input()) +predicted_value = 0 +last_colour = bool(int(string[0])) +for s in string[1:]: +    was_white = bool(int(s)) +    if last_colour == was_white: +        predicted_value += 1 +        last_colour = not was_white +    else: +        last_colour = was_white +print(predicted_value)