N = int(eval(input()))

S = eval(input())

now = ""

ans = 0

for i in range(N):

    if S[i] != now:

        ans += 1

        now = S[i]

print(ans)

import sys



def solve():

    input = sys.stdin.readline

    N = int(eval(input()))

    S = input().strip("\n")

    S += "0"

    count = 0

    nowCol = S[0]

    for i in range(1, N + 1):

        if S[i] != nowCol:

            count += 1

            nowCol = S[i]

    print(count)



    return 0



if __name__ == "__main__":

    solve()
N = int(eval(input()))
S = eval(input())
now = ""
ans = 0
for i in range(N):
    if S[i] != now:
        ans += 1
        now = S[i]
print(ans)

import sys


def solve():
    input = sys.stdin.readline
    N = int(eval(input()))
    S = input().strip("\n")
    S += "0"
    count = 0
    nowCol = S[0]
    for i in range(1, N + 1):
        if S[i] != nowCol:
            count += 1
            nowCol = S[i]
    print(count)
    return 0


if __name__ == "__main__":
    solve()

-N = int(eval(input())) -S = eval(input()) -now = "" -ans = 0 -for i in range(N): -    if S[i] != now: -        ans += 1 -        now = S[i] -print(ans) +import sys + + +def solve(): +    input = sys.stdin.readline +    N = int(eval(input())) +    S = input().strip("\n") +    S += "0" +    count = 0 +    nowCol = S[0] +    for i in range(1, N + 1): +        if S[i] != nowCol: +            count += 1 +            nowCol = S[i] +    print(count) +    return 0 + + +if __name__ == "__main__": +    solve()