# ABC143C - Slimes

from itertools import groupby





def main():

    N = int(eval(input()))

    S = input().rstrip()

    ans = len(tuple(groupby(S)))

    print(ans)





if __name__ == "__main__":

    main()
def main():

    N = int(eval(input()))

    S = input().rstrip()

    S += "."

    ans, cur = 0, S[0]

    for s in S[1:]:

        if s != cur:

          ans += 1

          cur = s

    print(ans)





if __name__ == "__main__":

    main()
# ABC143C - Slimes
from itertools import groupby


def main():
    N = int(eval(input()))
    S = input().rstrip()
    ans = len(tuple(groupby(S)))
    print(ans)


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    S = input().rstrip()
    S += "."
    ans, cur = 0, S[0]
    for s in S[1:]:
        if s != cur:
            ans += 1
            cur = s
    print(ans)


if __name__ == "__main__":
    main()

-# ABC143C - Slimes -from itertools import groupby - - -    ans = len(tuple(groupby(S))) +    S += "." +    ans, cur = 0, S[0] +    for s in S[1:]: +        if s != cur: +            ans += 1 +            cur = s