board = eval(input())



changes = 1

currSeq = board[0]



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

	current = board[i]

	if current != currSeq:

		changes += 1

		currSeq = current



print((changes - 1))
x = input()

out = 0

curchar = x[0]

for d in range(0, len(x)):

 if curchar != x[d]:

  curchar = x[d]

  out += 1

print(out)
board = eval(input())
changes = 1
currSeq = board[0]
for i in range(1, len(board)):
    current = board[i]
    if current != currSeq:
        changes += 1
        currSeq = current
print((changes - 1))

x = input()
out = 0
curchar = x[0]
for d in range(0, len(x)):
    if curchar != x[d]:
        curchar = x[d]
        out += 1
print(out)

-board = eval(input()) -changes = 1 -currSeq = board[0] -for i in range(1, len(board)): -    current = board[i] -    if current != currSeq: -        changes += 1 -        currSeq = current -print((changes - 1)) +x = input() +out = 0 +curchar = x[0] +for d in range(0, len(x)): +    if curchar != x[d]: +        curchar = x[d] +        out += 1 +print(out)