li=list(eval(input()))

ans=0

for n in range(len(li)-1):

  if li[n]!=li[n+1]:

    ans+=1

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

n = len(s)

t = s[0]

ans = 0

for i in range(n):

    if s[i] != t:

        ans += 1

        t = s[i]

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

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

-li = list(eval(input())) +s = eval(input()) +n = len(s) +t = s[0] -for n in range(len(li) - 1): -    if li[n] != li[n + 1]: +for i in range(n): +    if s[i] != t: +        t = s[i]