//using AtCoder; class Program { static void Main() { string S = Console.ReadLine(); int ans = 0; for (int i = 0; i + 2 < S.Length; i++) { bool ok = false; if (S[i] == S[i + 1] && S[i + 1] != S[i + 2]) ok = true; if (S[i] != S[i + 1] && S[i + 1] == S[i + 2]) ok = true; if (ok) ans++; } Console.WriteLine(ans); } }