S = input()
flg = 1
ans = S
if len(S) >= 2:
  while flg == 1:
      flg = 0
      for i in range(len(ans)-1):
        if ans[i]==ans[i+1]:
          ans = ans[:i]+ans[i+2:]
          flg = 1
          break
print(len(S)-len(ans))