"""

author : halo2halo

date : 4, Feb, 2020

"""



import sys

import itertools



# import math



# import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

INF = 10 ** 9



S = readline().decode('utf8').rstrip()

L = len(S)





def odd(M):

    while len(M) != L:

        if len(M) % 2 == 0:

            M += '1'

        else:

            M += '0'

    return M





def even(M):

    while len(M) != L:

        if len(M) % 2 == 0:

            M += '0'

        else:

            M += '1'

    return M





temp = ''

A = odd(temp)

B = even(temp)

na = sum(i == j for i, j in zip(S, A))

nb = sum(i == j for i, j in zip(S, B))

print((min(na, nb)))

"""

author : halo2halo

date : 4, Feb, 2020

"""



import sys

import itertools



# import math



# import numpy as np



read = sys.stdin.buffer.read

readline = sys.stdin.buffer.readline

readlines = sys.stdin.buffer.readlines

INF = 10 ** 9



S = readline().decode('utf8').rstrip()



f0 = S[::2].count('0') + S[1::2].count('1')

f1 = S[::2].count('1') + S[1::2].count('0')

print((min(f0, f1)))
"""
author : halo2halo
date : 4, Feb, 2020
"""
import sys
import itertools

# import math
# import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10**9
S = readline().decode("utf8").rstrip()
L = len(S)


def odd(M):
    while len(M) != L:
        if len(M) % 2 == 0:
            M += "1"
        else:
            M += "0"
    return M


def even(M):
    while len(M) != L:
        if len(M) % 2 == 0:
            M += "0"
        else:
            M += "1"
    return M


temp = ""
A = odd(temp)
B = even(temp)
na = sum(i == j for i, j in zip(S, A))
nb = sum(i == j for i, j in zip(S, B))
print((min(na, nb)))

"""
author : halo2halo
date : 4, Feb, 2020
"""
import sys
import itertools

# import math
# import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
INF = 10**9
S = readline().decode("utf8").rstrip()
f0 = S[::2].count("0") + S[1::2].count("1")
f1 = S[::2].count("1") + S[1::2].count("0")
print((min(f0, f1)))

-L = len(S) - - -def odd(M): -    while len(M) != L: -        if len(M) % 2 == 0: -            M += "1" -        else: -            M += "0" -    return M - - -def even(M): -    while len(M) != L: -        if len(M) % 2 == 0: -            M += "0" -        else: -            M += "1" -    return M - - -temp = "" -A = odd(temp) -B = even(temp) -na = sum(i == j for i, j in zip(S, A)) -nb = sum(i == j for i, j in zip(S, B)) -print((min(na, nb))) +f0 = S[::2].count("0") + S[1::2].count("1") +f1 = S[::2].count("1") + S[1::2].count("0") +print((min(f0, f1)))