S = input() A = 0 for i in range(len(S) - 1): if S[i] == S[i+1]: A = A + 1 print(A)