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