#!/usr/bin/env python3

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





def main():

    S = list(map(int, list(eval(input()))))



    result = 0

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



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

            if S[i] == 1:

                S[i] = 0

            else:

                S[i] = 1

            result += 1



    print(result)





if __name__ == "__main__":

    main()

#!/usr/bin/env python3

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





def main():



    S = eval(input())



    n = len(S)

    a = "10" * (n // 2) + "1" * (n % 2)

    b = "01" * (n // 2) + "0" * (n % 2)



    result = min(bin(int(S, 2) ^ int(a, 2)).count("1"),

                 bin(int(S, 2) ^ int(b, 2)).count("1"))



    print(result)





if __name__ == "__main__":

    main()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
    S = list(map(int, list(eval(input()))))
    result = 0
    for i in range(1, len(S)):
        if S[i - 1] == S[i]:
            if S[i] == 1:
                S[i] = 0
            else:
                S[i] = 1
            result += 1
    print(result)


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def main():
    S = eval(input())
    n = len(S)
    a = "10" * (n // 2) + "1" * (n % 2)
    b = "01" * (n // 2) + "0" * (n % 2)
    result = min(
        bin(int(S, 2) ^ int(a, 2)).count("1"), bin(int(S, 2) ^ int(b, 2)).count("1")
    )
    print(result)


if __name__ == "__main__":
    main()

-    S = list(map(int, list(eval(input())))) -    result = 0 -    for i in range(1, len(S)): -        if S[i - 1] == S[i]: -            if S[i] == 1: -                S[i] = 0 -            else: -                S[i] = 1 -            result += 1 +    S = eval(input()) +    n = len(S) +    a = "10" * (n // 2) + "1" * (n % 2) +    b = "01" * (n // 2) + "0" * (n % 2) +    result = min( +        bin(int(S, 2) ^ int(a, 2)).count("1"), bin(int(S, 2) ^ int(b, 2)).count("1") +    )