s = eval(input())

cnt = 1

cw = s[0]

for i in range(len(s)):

  if s[i] != cw: 

    cnt += 1

    cw = s[i]

print((cnt - 1))
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())
cnt = 1
cw = s[0]
for i in range(len(s)):
    if s[i] != cw:
        cnt += 1
        cw = s[i]
print((cnt - 1))

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

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