s = input()

result = []
a = 0
for i in range(len(s)-1):
  if(s[i]==s[i+1]):
    a+=1
  else:
    result.append(a)
    a=0
    result.append(a)

tyohuku = len([i for i in result if i != 0])
print(len(s) - tyohuku)
