N=int(eval(input()))

S=list(map(str,eval(input())))

i=0

while i!=(len(S)-1):

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

        S.pop(i+1)

    else:

        i+=1

print((len(S)))
N=int(eval(input()))

S=list(map(str,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(map(str, eval(input())))
i = 0
while i != (len(S) - 1):
    if S[i] == S[i + 1]:
        S.pop(i + 1)
    else:
        i += 1
print((len(S)))

N = int(eval(input()))
S = list(map(str, eval(input())))
ans = 1
for i in range(N - 1):
    if S[i] != S[i + 1]:
        ans += 1
print(ans)

-i = 0 -while i != (len(S) - 1): -    if S[i] == S[i + 1]: -        S.pop(i + 1) -    else: -        i += 1 -print((len(S))) +ans = 1 +for i in range(N - 1): +    if S[i] != S[i + 1]: +        ans += 1 +print(ans)