l = list(eval(input()))

now = l[0]

count = 0



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

  if not now == l[i]:

    count += 1

    now = l[i]



print(count)
l = list(eval(input()))

now = l[0]

count = 0

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

  if not l[i] == now:

    count += 1

    now = l[i]



print(count)
l = list(eval(input()))
now = l[0]
count = 0
for i in range(1, len(l)):
    if not now == l[i]:
        count += 1
        now = l[i]
print(count)

l = list(eval(input()))
now = l[0]
count = 0
for i in range(1, len(l)):
    if not l[i] == now:
        count += 1
        now = l[i]
print(count)

-    if not now == l[i]: +    if not l[i] == now: