import math

s = input()

count = 0
prev = ''
for c in s:
    if prev == '':
        prev = c
        continue
    if prev == c:
        count += 1
    prev = c

print(math.ceil(count/2))
