s = list(eval(input()))



ans = 0

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

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

        ans += 1



print(ans)
s = eval(input())



ans = 0

tmp = s[0]

for x in s[1:]:

    if x != tmp:

        ans += 1

        tmp = x



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

s = eval(input())
ans = 0
tmp = s[0]
for x in s[1:]:
    if x != tmp:
        ans += 1
        tmp = x
print(ans)

-s = list(eval(input())) +s = eval(input()) -for i in range(1, len(s)): -    if s[i - 1] != s[i]: +tmp = s[0] +for x in s[1:]: +    if x != tmp: +        tmp = x