def main():

    N = int(eval(input()))

    S = eval(input())



    merge = []

    sura = S[0]



    merge.append(sura)



    for i in range(1, N):



        if sura == S[i]:

            continue

        else:

            sura = S[i]

            merge.append(S[i])



    print((len(merge)))





if __name__ == "__main__":

    main()

def main():

    N = int(eval(input()))

    S = list(eval(input()))



    merge = []

    sura = S[0]



    merge.append(sura)



    for i in S:

        if i != merge[-1]:

            merge.append(i)



    print((len(merge)))





if __name__ == "__main__":

    main()

def main():
    N = int(eval(input()))
    S = eval(input())
    merge = []
    sura = S[0]
    merge.append(sura)
    for i in range(1, N):
        if sura == S[i]:
            continue
        else:
            sura = S[i]
            merge.append(S[i])
    print((len(merge)))


if __name__ == "__main__":
    main()

def main():
    N = int(eval(input()))
    S = list(eval(input()))
    merge = []
    sura = S[0]
    merge.append(sura)
    for i in S:
        if i != merge[-1]:
            merge.append(i)
    print((len(merge)))


if __name__ == "__main__":
    main()

-    S = eval(input()) +    S = list(eval(input())) -    for i in range(1, N): -        if sura == S[i]: -            continue -        else: -            sura = S[i] -            merge.append(S[i]) +    for i in S: +        if i != merge[-1]: +            merge.append(i)