s=eval(input())

v=0

for i in range(1,len(s))[::-1]:

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

        v+=1

print(v)
S = eval(input())

N = len(S)

if N==1:

    print((0))

else:

    s = S[0]

    ans=0

    for i in S[1:]:

        if i!=s:

            s=i

            ans+=1

    print(ans)

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

S = eval(input())
N = len(S)
if N == 1:
    print((0))
else:
    s = S[0]
    ans = 0
    for i in S[1:]:
        if i != s:
            s = i
            ans += 1
    print(ans)

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