S = eval(input())



last = ""

ls = []

for s in S:

    if s != last:

        last = s

        ls.append(s)

    else:

        ls[-1] += s



print((len(ls)-1))
s = eval(input())

prev = ans = -1

for c in s:

    if prev != c:

        prev = c

        ans += 1

print(ans)
S = eval(input())
last = ""
ls = []
for s in S:
    if s != last:
        last = s
        ls.append(s)
    else:
        ls[-1] += s
print((len(ls) - 1))

s = eval(input())
prev = ans = -1
for c in s:
    if prev != c:
        prev = c
        ans += 1
print(ans)

-S = eval(input()) -last = "" -ls = [] -for s in S: -    if s != last: -        last = s -        ls.append(s) -    else: -        ls[-1] += s -print((len(ls) - 1)) +s = eval(input()) +prev = ans = -1 +for c in s: +    if prev != c: +        prev = c +        ans += 1 +print(ans)