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