from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]

dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def ceil(a, b):

    return (a + b - 1) // b





# aとbの最大公約数

def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)





# aとbの最小公倍数

def lcm(a, b):

    g = gcd(a, b)

    return a / g * b





def solve(S, n):

    ans = 0



    for i in range(len(S)):

        if int(S[i]) == n:

            pass

        else:

            ans += 1



        n = 1 - n



    return ans





def main():

    S = eval(input())



    print((min(solve(S, 0), solve(S, 1))))





if __name__ == '__main__':

    main()

#!/usr/bin/env python3

from collections import defaultdict, Counter

from itertools import product, groupby, count, permutations, combinations

from math import pi, sqrt

from collections import deque

from bisect import bisect, bisect_left, bisect_right

from string import ascii_lowercase

from functools import lru_cache

import sys

sys.setrecursionlimit(10000)

INF = float("inf")

YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"

dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]

dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]





def inside(y, x, H, W):

    return 0 <= y < H and 0 <= x < W





def ceil(a, b):

    return (a + b - 1) // b





def sum_of_arithmetic_progression(s, d, n):

    return n * (2 * s + (n - 1) * d) // 2





def gcd(a, b):

    if b == 0:

        return a

    return gcd(b, a % b)





def lcm(a, b):

    g = gcd(a, b)

    return a / g * b





def solve():

    return





def main():

    S = eval(input())

    ans1, ans2 = 0, 0

    for i in range(len(S)):

        if i % 2 == 0:

            ans1 += S[i] != '0'

            ans2 += S[i] != '1'

        else:

            ans1 += S[i] != '1'

            ans2 += S[i] != '0'



    print((min(ans1, ans2)))





if __name__ == '__main__':

    main()

from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve(S, n):
    ans = 0
    for i in range(len(S)):
        if int(S[i]) == n:
            pass
        else:
            ans += 1
        n = 1 - n
    return ans


def main():
    S = eval(input())
    print((min(solve(S, 0), solve(S, 1))))


if __name__ == "__main__":
    main()

#!/usr/bin/env python3
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys

sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def solve():
    return


def main():
    S = eval(input())
    ans1, ans2 = 0, 0
    for i in range(len(S)):
        if i % 2 == 0:
            ans1 += S[i] != "0"
            ans2 += S[i] != "1"
        else:
            ans1 += S[i] != "1"
            ans2 += S[i] != "0"
    print((min(ans1, ans2)))


if __name__ == "__main__":
    main()

+#!/usr/bin/env python3 -# aとbの最大公約数 +def sum_of_arithmetic_progression(s, d, n): +    return n * (2 * s + (n - 1) * d) // 2 + + -# aとbの最小公倍数 -def solve(S, n): -    ans = 0 -    for i in range(len(S)): -        if int(S[i]) == n: -            pass -        else: -            ans += 1 -        n = 1 - n -    return ans +def solve(): +    return -    print((min(solve(S, 0), solve(S, 1)))) +    ans1, ans2 = 0, 0 +    for i in range(len(S)): +        if i % 2 == 0: +            ans1 += S[i] != "0" +            ans2 += S[i] != "1" +        else: +            ans1 += S[i] != "1" +            ans2 += S[i] != "0" +    print((min(ans1, ans2)))