import sys

# import bisect
# import numpy as np
# from collections import deque
from collections import deque
# map(int, sys.stdin.read().split())
# import heapq
import bisect
import math

def input():
    return sys.stdin.readline().rstrip()


def main():
    N =int(input())
    S = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count)


if __name__ == "__main__":
    main() import sys sys from collections import deque import bisect bisect import math math def input():
    return sys.stdin.readline().rstrip() input return 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 = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count) main N =int(input()) N int(input()) int input() input S = input() S input() input pre ="A" pre "A" count=0 count 0 for i in S:
        if i !=pre:
            count+=1
        pre = i
     i S if i !=pre:
            count+=1
         i !=pre i pre count+=1 count 1 pre = i pre i print(count) print count if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def input():
    return sys.stdin.readline().rstrip() def input():
    return sys.stdin.readline().rstrip() input def main():
    N =int(input())
    S = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count) def main():
    N =int(input())
    S = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count) main
import sys

# import bisect
# import numpy as np
# from collections import deque
from collections import deque
# map(int, sys.stdin.read().split())
# import heapq
import bisect
import math

def input():
    return sys.stdin.readline().rstrip()


def main():
    N =int(input())
    S = input()
    pre ="A"
    count=0
    for i in S:
        if i !=pre:
            count+=1
        pre = i
    print(count)


if __name__ == "__main__":
    main()
