S = input() N = len(S) ans = 0 for i in range(N-2): a,b,c = S[i:i+3] if (a==b and a!=c) or (a==c and a!=b) or (b==c and a!=b): ans += 1 print(ans)