def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans)


if __name__ == '__main__':
    main() def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans) main N = int(input()) N int(input()) int input() input S = input().rstrip() S input().rstrip() ().rstrip () input rstrip current_char = S[0] current_char S[0] S 0 ans = 1 ans 1 for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
     idx range(1, N) range 1 N if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
     S[idx] != current_char S[idx] S idx current_char ans += 1 ans 1 current_char = S[idx] current_char S[idx] S idx print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans) def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans) main
def main():
    N = int(input())
    S = input().rstrip()
    current_char = S[0]
    ans = 1
    for idx in range(1, N):
        if S[idx] != current_char:
            ans += 1
            current_char = S[idx]
    print(ans)


if __name__ == '__main__':
    main()
