N = int(eval(input()))

S = eval(input())



slimes = []



for i in range(N):

    if i == 0 or slimes[-1] != S[i]:

        slimes.append(S[i])



print((len(slimes)))

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 = eval(input())
slimes = []
for i in range(N):
    if i == 0 or slimes[-1] != S[i]:
        slimes.append(S[i])
print((len(slimes)))

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)

-slimes = [] -for i in range(N): -    if i == 0 or slimes[-1] != S[i]: -        slimes.append(S[i]) -print((len(slimes))) +ans = 1 +for i in range(N - 1): +    if S[i] != S[i + 1]: +        ans += 1 +print(ans)