n = int(eval(input()))

s = eval(input())



ans = 1

for i in range(1,n):

    if s[i]!=s[i-1]:

        ans+=1

print(ans)


def I(): return int(eval(input()))

def MI(): return list(map(int, input().split()))

def LI(): return list(map(int, input().split()))



def main():

    mod=10**9+7

    cnt=0

    N=I()

    S=eval(input())

    now="A"

    for i in range(N):

        if S[i]!=now:

            cnt+=1

        now=S[i]

        

    print(cnt)



main()

n = int(eval(input()))
s = eval(input())
ans = 1
for i in range(1, n):
    if s[i] != s[i - 1]:
        ans += 1
print(ans)

def I():
    return int(eval(input()))


def MI():
    return list(map(int, input().split()))


def LI():
    return list(map(int, input().split()))


def main():
    mod = 10**9 + 7
    cnt = 0
    N = I()
    S = eval(input())
    now = "A"
    for i in range(N):
        if S[i] != now:
            cnt += 1
        now = S[i]
    print(cnt)


main()

-n = int(eval(input())) -s = eval(input()) -ans = 1 -for i in range(1, n): -    if s[i] != s[i - 1]: -        ans += 1 -print(ans) +def I(): +    return int(eval(input())) + + +def MI(): +    return list(map(int, input().split())) + + +def LI(): +    return list(map(int, input().split())) + + +def main(): +    mod = 10**9 + 7 +    cnt = 0 +    N = I() +    S = eval(input()) +    now = "A" +    for i in range(N): +        if S[i] != now: +            cnt += 1 +        now = S[i] +    print(cnt) + + +main()