def main():
    import sys
    readline = sys.stdin.buffer.readline

    n = int(readline())
    s = readline().rstrip().decode('utf-8')

    l = ''
    ans = 0
    for i in s:
        if i != l:
            l = i
            ans += 1 
    print(ans)

if __name__ == '__main__':
    main() def main():
    import sys
    readline = sys.stdin.buffer.readline

    n = int(readline())
    s = readline().rstrip().decode('utf-8')

    l = ''
    ans = 0
    for i in s:
        if i != l:
            l = i
            ans += 1 
    print(ans) main import sys sys readline = sys.stdin.buffer.readline readline sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline n = int(readline()) n int(readline()) int readline() readline s = readline().rstrip().decode('utf-8') s readline().rstrip().decode('utf-8') ().rstrip().decode ().rstrip() ().rstrip () readline rstrip decode 'utf-8' l = '' l '' ans = 0 ans 0 for i in s:
        if i != l:
            l = i
            ans += 1 
     i s if i != l:
            l = i
            ans += 1 
     i != l i l l = i l i ans += 1 ans 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    import sys
    readline = sys.stdin.buffer.readline

    n = int(readline())
    s = readline().rstrip().decode('utf-8')

    l = ''
    ans = 0
    for i in s:
        if i != l:
            l = i
            ans += 1 
    print(ans) def main():
    import sys
    readline = sys.stdin.buffer.readline

    n = int(readline())
    s = readline().rstrip().decode('utf-8')

    l = ''
    ans = 0
    for i in s:
        if i != l:
            l = i
            ans += 1 
    print(ans) main
def main():
    import sys
    readline = sys.stdin.buffer.readline

    n = int(readline())
    s = readline().rstrip().decode('utf-8')

    l = ''
    ans = 0
    for i in s:
        if i != l:
            l = i
            ans += 1 
    print(ans)

if __name__ == '__main__':
    main()