from itertools import groupby

S = eval(input())

G = groupby(S)

print((len(list(G))-1))
from itertools import groupby



S = groupby(eval(input()))

cnt = sum([1 for k, v in S])

print((cnt-1))



from itertools import groupby

S = eval(input())
G = groupby(S)
print((len(list(G)) - 1))

from itertools import groupby

S = groupby(eval(input()))
cnt = sum([1 for k, v in S])
print((cnt - 1))

-S = eval(input()) -G = groupby(S) -print((len(list(G)) - 1)) +S = groupby(eval(input())) +cnt = sum([1 for k, v in S]) +print((cnt - 1))