N = int(eval(input()))

S = eval(input())

postc = ''

answer = 0

for c in S:

    if c != postc:

        answer += 1

    postc = c

print(answer)

N = int(eval(input()))

S = eval(input())

cnt = 0

post_c = ''

for i in range(len(S)):

    if post_c != S[i]:

        post_c = S[i]

        cnt += 1

print(cnt)

N = int(eval(input()))
S = eval(input())
postc = ""
answer = 0
for c in S:
    if c != postc:
        answer += 1
    postc = c
print(answer)

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

-postc = "" -answer = 0 -for c in S: -    if c != postc: -        answer += 1 -    postc = c -print(answer) +cnt = 0 +post_c = "" +for i in range(len(S)): +    if post_c != S[i]: +        post_c = S[i] +        cnt += 1 +print(cnt)