N = int(eval(input()))

S = eval(input())

s = S[0]

for i in range(1, N):

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

        s += S[i]

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

s = eval(input())



cnt = 1



for i in range(n-1):

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

        cnt += 1

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

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

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