import sys



S = list(eval(input()))

ls = len(S)



if ls == 1:

    print((0))

    sys.exit()

elif len(set(S)) == 1:

    print((0))

    sys.exit()



tg = S[0]

n = 0

for i in range(ls):

    if i == 0:

        continue

    else:

        if S[i] != tg:

            n += 1

            tg = S[i]

print(n)
S = list(eval(input()))

ls = len(S)

p = S[0]

ans = 0

for i in range(1, ls):

    if S[i] != p:

        ans += 1

        p = S[i]

print(ans)
import sys

S = list(eval(input()))
ls = len(S)
if ls == 1:
    print((0))
    sys.exit()
elif len(set(S)) == 1:
    print((0))
    sys.exit()
tg = S[0]
n = 0
for i in range(ls):
    if i == 0:
        continue
    else:
        if S[i] != tg:
            n += 1
            tg = S[i]
print(n)

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

-import sys - -if ls == 1: -    print((0)) -    sys.exit() -elif len(set(S)) == 1: -    print((0)) -    sys.exit() -tg = S[0] -n = 0 -for i in range(ls): -    if i == 0: -        continue -    else: -        if S[i] != tg: -            n += 1 -            tg = S[i] -print(n) +p = S[0] +ans = 0 +for i in range(1, ls): +    if S[i] != p: +        ans += 1 +        p = S[i] +print(ans)