n = int(eval(input()))

colors = eval(input())



i = 0

leght = n

result = list(colors[0])



for i in range(n-1):

  if colors[i] != colors[i+1]:

  	result.append(colors[i+1])

    

print((len(result)))
n = int(eval(input()))

str = eval(input())

slim = [str[0]]

for i in range(n):

  if str[i] != slim[-1]:

  	slim.append(str[i]) 

  

print((len(slim)))
n = int(eval(input()))
colors = eval(input())
i = 0
leght = n
result = list(colors[0])
for i in range(n - 1):
    if colors[i] != colors[i + 1]:
        result.append(colors[i + 1])
print((len(result)))

n = int(eval(input()))
str = eval(input())
slim = [str[0]]
for i in range(n):
    if str[i] != slim[-1]:
        slim.append(str[i])
print((len(slim)))

-colors = eval(input()) -i = 0 -leght = n -result = list(colors[0]) -for i in range(n - 1): -    if colors[i] != colors[i + 1]: -        result.append(colors[i + 1]) -print((len(result))) +str = eval(input()) +slim = [str[0]] +for i in range(n): +    if str[i] != slim[-1]: +        slim.append(str[i]) +print((len(slim)))