S = input() c = 0 for i in range(len(S)-2): s1 = S[i] s2 = S[i+1] s3 = S[i+2] if (s1 == s2 and s2 != s3) or (s1 != s2 and s2 == s3): c += 1 print(c)