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