import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    S=list(input())

    pre = None
    X = []
    for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
    print(len(X))






if __name__ == "__main__":
    main() import sys sys sys.setrecursionlimit(10**9) sys.setrecursionlimit sys setrecursionlimit 10**9 10 9 def mi(): return map(int,input().split()) mi def ii(): return int(input()) ii def isp(): return input().split() isp def deb(text): print("-------\n{}\n-------".format(text)) deb text text INF=10**20 INF 10**20 10 20 def main():
    N=ii()
    S=list(input())

    pre = None
    X = []
    for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
    print(len(X)) main N=ii() N ii() ii S=list(input()) S list(input()) list input() input pre = None pre None X = [] X [] for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
     s S if s != pre:
            X.append(s)

         s != pre s pre X.append(s) X.append X append s pre = s pre s print(len(X)) print len(X) len X if __name__ == "__main__":
    main() __name__ == "__main__" __name__ "__main__" main() main def main():
    N=ii()
    S=list(input())

    pre = None
    X = []
    for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
    print(len(X)) def main():
    N=ii()
    S=list(input())

    pre = None
    X = []
    for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
    print(len(X)) main def ii(): return int(input()) def ii(): return int(input()) ii def deb(text): print("-------\n{}\n-------".format(text)) def deb(text): print("-------\n{}\n-------".format(text)) deb INF=10**20 10**20 INF def isp(): return input().split() def isp(): return input().split() isp def mi(): return map(int,input().split()) def mi(): return map(int,input().split()) mi
import sys
sys.setrecursionlimit(10**9)

def mi(): return map(int,input().split())
def ii(): return int(input())
def isp(): return input().split()
def deb(text): print("-------\n{}\n-------".format(text))

INF=10**20
def main():
    N=ii()
    S=list(input())

    pre = None
    X = []
    for s in S:
        if s != pre:
            X.append(s)

        pre = s
    
    print(len(X))






if __name__ == "__main__":
    main()