import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = list(input())
    ans = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
    print(ans+1)

if __name__ == '__main__':
    main() import sys sys input = lambda: sys.stdin.readline().rstrip() input lambda: sys.stdin.readline().rstrip() sys.stdin.readline().rstrip() sys.stdin.readline().rstrip sys.stdin.readline() sys.stdin.readline sys.stdin sys stdin readline rstrip def main():
    n = int(input())
    s = list(input())
    ans = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
    print(ans+1) main n = int(input()) n int(input()) int input() input s = list(input()) s list(input()) list input() input ans = 0 ans 0 for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
     i range(1, n) range 1 n if s[i] != s[i-1]:
            ans += 1
     s[i] != s[i-1] s[i] s i s[i-1] s i-1 i 1 ans += 1 ans 1 print(ans+1) print ans+1 ans 1 if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    n = int(input())
    s = list(input())
    ans = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
    print(ans+1) def main():
    n = int(input())
    s = list(input())
    ans = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
    print(ans+1) main input = lambda: sys.stdin.readline().rstrip() lambda: sys.stdin.readline().rstrip() input
import sys
input = lambda: sys.stdin.readline().rstrip()

def main():
    n = int(input())
    s = list(input())
    ans = 0
    for i in range(1, n):
        if s[i] != s[i-1]:
            ans += 1
    print(ans+1)

if __name__ == '__main__':
    main()