s = input() count = 0 for i in range(len(s)-2): if len(set(s[i:i+3])) == 2: count += 1 print(count)