s = eval(input())



cnt = 1

for i in range(1,len(s)):

    if s[i] != s[i - 1]:

        cnt += 1

print((cnt - 1))

s = eval(input())



print((sum(s[i] != s[i - 1] for i in range(1, len(s)))))

s = eval(input())
cnt = 1
for i in range(1, len(s)):
    if s[i] != s[i - 1]:
        cnt += 1
print((cnt - 1))

s = eval(input())
print((sum(s[i] != s[i - 1] for i in range(1, len(s)))))

-cnt = 1 -for i in range(1, len(s)): -    if s[i] != s[i - 1]: -        cnt += 1 -print((cnt - 1)) +print((sum(s[i] != s[i - 1] for i in range(1, len(s)))))