#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    S = input()
    nw = S[0]
    ret = 1
    for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret)

if __name__ == '__main__':
    main() def main():
    N = int(input())
    S = input()
    nw = S[0]
    ret = 1
    for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret) main N = int(input()) N int(input()) int input() input S = input() S input() input nw = S[0] nw S[0] S 0 ret = 1 ret 1 for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
     i range(1,N) range 1 N if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
     nw == S[i] nw S[i] S i continue nw = S[i] nw S[i] S i ret += 1 ret 1 print(ret) print ret if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    S = input()
    nw = S[0]
    ret = 1
    for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret) def main():
    N = int(input())
    S = input()
    nw = S[0]
    ret = 1
    for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret) main
#!/usr/bin python3
# -*- coding: utf-8 -*-

def main():
    N = int(input())
    S = input()
    nw = S[0]
    ret = 1
    for i in range(1,N):
        if nw == S[i]:
            continue
        else:
            nw = S[i]
            ret += 1
    print(ret)

if __name__ == '__main__':
    main()