n=int(eval(input()))

s=eval(input())

ss=set(s)

l=s[0]

count=1

for j in range(n):

    if l!=s[j]:

        count+=1

        l=s[j]

print(count)
n=int(eval(input()))

s=eval(input())

cnt=1

temp=s[0]

for i in range(n):

    if temp!=s[i]:

        cnt+=1

        temp=s[i]

print(cnt)
n = int(eval(input()))
s = eval(input())
ss = set(s)
l = s[0]
count = 1
for j in range(n):
    if l != s[j]:
        count += 1
        l = s[j]
print(count)

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

-ss = set(s) -l = s[0] -count = 1 -for j in range(n): -    if l != s[j]: -        count += 1 -        l = s[j] -print(count) +cnt = 1 +temp = s[0] +for i in range(n): +    if temp != s[i]: +        cnt += 1 +        temp = s[i] +print(cnt)