def main():
    N = int(input())
    S = input()
    fusion = [S[0]]
    prev = S[0]
    for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
    print(len(fusion))
main() def main():
    N = int(input())
    S = input()
    fusion = [S[0]]
    prev = S[0]
    for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
    print(len(fusion)) main N = int(input()) N int(input()) int input() input S = input() S input() input fusion = [S[0]] fusion [S[0]] S[0] S 0 prev = S[0] prev S[0] S 0 for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
     s S[1:] S 1: 1 if s == prev:
            continue
         s == prev s prev continue fusion.append(s) fusion.append fusion append s prev = s prev s print(len(fusion)) print len(fusion) len fusion main() main def main():
    N = int(input())
    S = input()
    fusion = [S[0]]
    prev = S[0]
    for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
    print(len(fusion)) def main():
    N = int(input())
    S = input()
    fusion = [S[0]]
    prev = S[0]
    for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
    print(len(fusion)) main
def main():
    N = int(input())
    S = input()
    fusion = [S[0]]
    prev = S[0]
    for s in S[1:]:
        if s == prev:
            continue
        fusion.append(s)
        prev = s
    print(len(fusion))
main()