import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from itertools import groupby

    N = int(readline())
    S = input()
    ans = 0
    for g in groupby(S):
        ans += 1

    print(ans)

if __name__ == '__main__':
    main() import sys sys readline = sys.stdin.readline readline sys.stdin.readline sys.stdin sys stdin readline MOD = 10 ** 9 + 7 MOD 10 ** 9 + 7 10 ** 9 10 9 7 INF = float('INF') INF float('INF') float 'INF' sys.setrecursionlimit(10 ** 5) sys.setrecursionlimit sys setrecursionlimit 10 ** 5 10 5 def main():
    from itertools import groupby

    N = int(readline())
    S = input()
    ans = 0
    for g in groupby(S):
        ans += 1

    print(ans) main from itertools import groupby N = int(readline()) N int(readline()) int readline() readline S = input() S input() input ans = 0 ans 0 for g in groupby(S):
        ans += 1

     g groupby(S) groupby S ans += 1 ans 1 print(ans) print ans if __name__ == '__main__':
    main() __name__ == '__main__' __name__ '__main__' main() main def main():
    from itertools import groupby

    N = int(readline())
    S = input()
    ans = 0
    for g in groupby(S):
        ans += 1

    print(ans) def main():
    from itertools import groupby

    N = int(readline())
    S = input()
    ans = 0
    for g in groupby(S):
        ans += 1

    print(ans) main MOD = 10 ** 9 + 7 10 ** 9 + 7 MOD INF = float('INF') float('INF') INF readline = sys.stdin.readline sys.stdin.readline readline
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    from itertools import groupby

    N = int(readline())
    S = input()
    ans = 0
    for g in groupby(S):
        ans += 1

    print(ans)

if __name__ == '__main__':
    main()
