N = int(eval(input()))

S = list(eval(input()))



index = 0

for i in range(N - 1):

    if S[index] == S[index + 1]:

        del S[index]

    else:

        index += 1



print((len(S)))

n = int(eval(input()))

s = eval(input())



ans = 1

for i in range(n - 1):

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

        ans += 1



print(ans)

N = int(eval(input()))
S = list(eval(input()))
index = 0
for i in range(N - 1):
    if S[index] == S[index + 1]:
        del S[index]
    else:
        index += 1
print((len(S)))

n = int(eval(input()))
s = eval(input())
ans = 1
for i in range(n - 1):
    if s[i] != s[i + 1]:
        ans += 1
print(ans)

-N = int(eval(input())) -S = list(eval(input())) -index = 0 -for i in range(N - 1): -    if S[index] == S[index + 1]: -        del S[index] -    else: -        index += 1 -print((len(S))) +n = int(eval(input())) +s = eval(input()) +ans = 1 +for i in range(n - 1): +    if s[i] != s[i + 1]: +        ans += 1 +print(ans)