n=int(eval(input()))

s=eval(input())

cnt=1

if n==1:

    print(cnt)

else:

    for i in range(n):

        if i==0: memo=s[i]

        else:

            if memo==s[i]:

                continue

            else:

                cnt+=1

                memo=s[i]

    

    print(cnt)
n=eval(input())

s=eval(input())

res=1

for i in range(1,int(n)):

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

        res+=1

print(res)
n = int(eval(input()))
s = eval(input())
cnt = 1
if n == 1:
    print(cnt)
else:
    for i in range(n):
        if i == 0:
            memo = s[i]
        else:
            if memo == s[i]:
                continue
            else:
                cnt += 1
                memo = s[i]
    print(cnt)

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

-n = int(eval(input())) +n = eval(input()) -cnt = 1 -if n == 1: -    print(cnt) -else: -    for i in range(n): -        if i == 0: -            memo = s[i] -        else: -            if memo == s[i]: -                continue -            else: -                cnt += 1 -                memo = s[i] -    print(cnt) +res = 1 +for i in range(1, int(n)): +    if s[i - 1] != s[i]: +        res += 1 +print(res)