def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

    
if '__main__' == __name__:
    resolve() def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

     resolve N = int(input()) N int(input()) int input() input S = input() S input() input ans = 0 ans 0 prev = "" prev "" for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
     c S if c == prev:
            continue
         c == prev c prev continue ans += 1 ans 1 prev = c prev c print(ans) print ans if '__main__' == __name__:
    resolve() '__main__' == __name__ '__main__' __name__ resolve() resolve def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

     def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

     resolve
def resolve():
    N = int(input())
    S = input()
    ans = 0
    prev = ""
    for c in S:
        if c == prev:
            continue
        ans += 1
        prev = c
    print(ans)

    
if '__main__' == __name__:
    resolve()