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)
def resolve():

    n = int(eval(input()))



    targets = eval(input())

    ans = 1



    for i in range(len(targets)-1):

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

            pass

        else:

            ans += 1



    print(ans)

resolve()
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)

def resolve():
    n = int(eval(input()))
    targets = eval(input())
    ans = 1
    for i in range(len(targets) - 1):
        if targets[i] == targets[i + 1]:
            pass
        else:
            ans += 1
    print(ans)


resolve()

-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) +def resolve(): +    n = int(eval(input())) +    targets = eval(input()) +    ans = 1 +    for i in range(len(targets) - 1): +        if targets[i] == targets[i + 1]: +            pass +        else: +            ans += 1 +    print(ans) + + +resolve()