def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main() def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt) main n = int(input()) n int(input()) int input() input s = list(input()) s list(input()) list input() input cnt = 1 cnt 1 for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
     i range(1, n) range 1 n if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
     s[i] == s[i-1] s[i] s i s[i-1] s i-1 i 1 continue cnt += 1 cnt 1 print(cnt) print cnt if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt) def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt) main
def main():
    n = int(input())
    s = list(input())
    cnt = 1
    for i in range(1, n):
        if s[i] == s[i-1]:
            continue
        else:
            cnt += 1
    print(cnt)

if __name__ == '__main__':
    main()