N = eval(input())

S = eval(input())



ans = 0

sav = ""

for index in range(int(N)):

    if sav == "":

        sav = S[index]

        ans += 1

    elif S[index] != sav:

        sav = S[index]

        ans += 1



print(ans)
N = eval(input())

S = eval(input())



ans = 1

sav = S[0]

for index in range(1, int(N)):

    if S[index] != sav:

        sav = S[index]

        ans += 1



print(ans)
N = eval(input())
S = eval(input())
ans = 0
sav = ""
for index in range(int(N)):
    if sav == "":
        sav = S[index]
        ans += 1
    elif S[index] != sav:
        sav = S[index]
        ans += 1
print(ans)

N = eval(input())
S = eval(input())
ans = 1
sav = S[0]
for index in range(1, int(N)):
    if S[index] != sav:
        sav = S[index]
        ans += 1
print(ans)

-ans = 0 -sav = "" -for index in range(int(N)): -    if sav == "": -        sav = S[index] -        ans += 1 -    elif S[index] != sav: +ans = 1 +sav = S[0] +for index in range(1, int(N)): +    if S[index] != sav: