S = str(input())
A = S
flag = True
while(flag):
    T = ""
    flag = False
    for i in range(1, len(S)):
        if int(S[i-1]) ^ int(S[i]):
            flag = True
            T = S[:i-1]+S[i+1:]
            S = T
            break
print(len(A)-len(S))
