#!/usr/bin/env python

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

def main():
    N = int(input())
    S = input()

    ans = 1
    for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

    print(ans)
    
if __name__ == "__main__":
    main() import sys sys input = sys.stdin.buffer.readline input sys.stdin.buffer.readline sys.stdin.buffer sys.stdin sys stdin buffer readline sys.setrecursionlimit(10**6) sys.setrecursionlimit sys setrecursionlimit 10**6 10 6 INF = float("inf") INF float("inf") float "inf" def main():
    N = int(input())
    S = input()

    ans = 1
    for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

    print(ans)
     main N = int(input()) N int(input()) int input() input S = input() S input() input ans = 1 ans 1 for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

     i range(N-1) range N-1 N 1 if S[i+1] != S[i]:
            ans += 1

     S[i+1] != S[i] S[i+1] S i+1 i 1 S[i] S i ans += 1 ans 1 print(ans) print ans if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main input = sys.stdin.buffer.readline sys.stdin.buffer.readline input INF = float("inf") float("inf") INF def main():
    N = int(input())
    S = input()

    ans = 1
    for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

    print(ans)
     def main():
    N = int(input())
    S = input()

    ans = 1
    for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

    print(ans)
     main
#!/usr/bin/env python

import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**6)
INF = float("inf")

def main():
    N = int(input())
    S = input()

    ans = 1
    for i in range(N-1):
        if S[i+1] != S[i]:
            ans += 1

    print(ans)
    
if __name__ == "__main__":
    main()