s = eval(input())



x = s[0]

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

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

        x += s[i]



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



x = 0

for i in range(len(s) - 1):

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

        x += 1



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

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

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