N = int(eval(input()))

S = list(eval(input())) + ['end']

cnt = 0



for i in range(N):

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

        cnt += 1

print(cnt)
N = int(eval(input()))

S = eval(input())

cnt = 0

for i in range(1, N):

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

        cnt += 1

print((cnt+1))

N = int(eval(input()))
S = list(eval(input())) + ["end"]
cnt = 0
for i in range(N):
    if S[i] != S[i + 1]:
        cnt += 1
print(cnt)

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

-S = list(eval(input())) + ["end"] +S = eval(input()) -for i in range(N): -    if S[i] != S[i + 1]: +for i in range(1, N): +    if S[i] != S[i - 1]: -print(cnt) +print((cnt + 1))