L = list(input())
i = 0
cnt = 0
for _ in range(len(L)):
    if ''.join(L[i:i+2]) == '01' or ''.join(L[i:i+2]) == '10':
        for j in range(i,i+2):
            L.pop(i)
            cnt += 1
        i = 0
    else:
        i += 1
print(cnt)