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