S = eval(input())



count = 0

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

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

        count += 1

print(count)
S = eval(input())



count = 0

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

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

        count += 1

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

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

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