s = eval(input())

cnt = 0

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

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

        cnt += 1

print(cnt)

s = eval(input())

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

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

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

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