N=list(eval(input()))



counter=0



pre = N.pop(0)

for n in N:

    if(pre == n):

        counter+=1

    if(pre == "0"):

        pre="1"

    else:

        pre="0"



print(counter)

def myAnswer(s:list) -> str:

   ans = 0

   pre =s.pop(0)

   for i in s:

      if(pre == i):

         ans += 1

         pre = "1" if(i == "0") else "0"

      else:

         pre = i

   return ans



def modelAnswer():

   tmp=1

def main():

   s = list(eval(input()))

   print((myAnswer(s)))



if __name__ == '__main__':

   main()
N = list(eval(input()))
counter = 0
pre = N.pop(0)
for n in N:
    if pre == n:
        counter += 1
    if pre == "0":
        pre = "1"
    else:
        pre = "0"
print(counter)

def myAnswer(s: list) -> str:
    ans = 0
    pre = s.pop(0)
    for i in s:
        if pre == i:
            ans += 1
            pre = "1" if (i == "0") else "0"
        else:
            pre = i
    return ans


def modelAnswer():
    tmp = 1


def main():
    s = list(eval(input()))
    print((myAnswer(s)))


if __name__ == "__main__":
    main()

-N = list(eval(input())) -counter = 0 -pre = N.pop(0) -for n in N: -    if pre == n: -        counter += 1 -    if pre == "0": -        pre = "1" -    else: -        pre = "0" -print(counter) +def myAnswer(s: list) -> str: +    ans = 0 +    pre = s.pop(0) +    for i in s: +        if pre == i: +            ans += 1 +            pre = "1" if (i == "0") else "0" +        else: +            pre = i +    return ans + + +def modelAnswer(): +    tmp = 1 + + +def main(): +    s = list(eval(input())) +    print((myAnswer(s))) + + +if __name__ == "__main__": +    main()