s = eval(input())

len_s = len(s)

cnt = 0

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

    memo_0 = s[i - 1]

    if s[i] != memo_0:

        cnt += 1

print(cnt)

s = eval(input())

cnt = 0

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

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

        cnt += 1

print(cnt)

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

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

-len_s = len(s) -    memo_0 = s[i - 1] -    if s[i] != memo_0: +    if s[i] != s[i - 1]: