# -*- coding: utf-8 -*-

n = int(eval(input()))  

s = eval(input()) 



c = s[0:1]

x = 1



for i in range(1,len(s)):

    # print(i,c,s[i:i+1],x)

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

        x = x + 1

        c = s[i:i+1]

print(x)
N=int(eval(input()))

S=eval(input())

count = 0

ans=0

j=''



for i in S:

    count +=1

    if (count>=2) & (i==j): continue

    else:

        j=i

        ans += 1



print(ans)
# -*- coding: utf-8 -*-
n = int(eval(input()))
s = eval(input())
c = s[0:1]
x = 1
for i in range(1, len(s)):
    # print(i,c,s[i:i+1],x)
    if s[i : i + 1] != c:
        x = x + 1
        c = s[i : i + 1]
print(x)

N = int(eval(input()))
S = eval(input())
count = 0
ans = 0
j = ""
for i in S:
    count += 1
    if (count >= 2) & (i == j):
        continue
    else:
        j = i
        ans += 1
print(ans)

-# -*- coding: utf-8 -*- -n = int(eval(input())) -s = eval(input()) -c = s[0:1] -x = 1 -for i in range(1, len(s)): -    # print(i,c,s[i:i+1],x) -    if s[i : i + 1] != c: -        x = x + 1 -        c = s[i : i + 1] -print(x) +N = int(eval(input())) +S = eval(input()) +count = 0 +ans = 0 +j = "" +for i in S: +    count += 1 +    if (count >= 2) & (i == j): +        continue +    else: +        j = i +        ans += 1 +print(ans)