s = input() ans = sum(s[i] == s[i+1] != s[i+2] or s[i] != s[i+1] == s[i+2] for i in range(len(s) - 2)) print(ans)