from collections import deque



def main():    

    n = int(eval(input()))

    s = eval(input())



    que = deque(s)

    ans = 0

    q2 = ''



    while len(que)>0:

        q1 = que.popleft()

        if q1 == q2:

            continue

        else:

            ans += 1

            q2 = q1

    print(ans)



if __name__ == '__main__':

    main()
def main():    

    n = int(eval(input()))

    s = eval(input())

    ans = 0

    q2 = ''



    for i in s:

        q1 = i

        if q1 != q2:

            ans += 1

            q2 = q1

    print(ans)



if __name__ == '__main__':

    main()
from collections import deque


def main():
    n = int(eval(input()))
    s = eval(input())
    que = deque(s)
    ans = 0
    q2 = ""
    while len(que) > 0:
        q1 = que.popleft()
        if q1 == q2:
            continue
        else:
            ans += 1
            q2 = q1
    print(ans)


if __name__ == "__main__":
    main()

def main():
    n = int(eval(input()))
    s = eval(input())
    ans = 0
    q2 = ""
    for i in s:
        q1 = i
        if q1 != q2:
            ans += 1
            q2 = q1
    print(ans)


if __name__ == "__main__":
    main()

-from collections import deque - - -    que = deque(s) -    while len(que) > 0: -        q1 = que.popleft() -        if q1 == q2: -            continue -        else: +    for i in s: +        q1 = i +        if q1 != q2: